Skip to content

Commit 2e0af7a

Browse files
committed
perf: early return on decimal char
1 parent b3519c1 commit 2e0af7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/parsers.pyx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ cdef class TextReader:
13591359

13601360
ignored_chars = b" +-"
13611361
digits = b"0123456789"
1362-
float_indicating_chars = {self.parser.decimal, b"e", b"E"}
1362+
float_indicating_chars = b"eE"
13631363

13641364
for i in range(lines):
13651365
COLITER_NEXT(it, word)
@@ -1370,7 +1370,9 @@ cdef class TextReader:
13701370
found_first_digit = False
13711371
j = 0
13721372
while word[j] != b"\0":
1373-
if not found_first_digit and word[j] in ignored_chars:
1373+
if word[j] == self.parser.decimal:
1374+
return True
1375+
elif not found_first_digit and word[j] in ignored_chars:
13741376
# no-op
13751377
pass
13761378
elif not found_first_digit and word[j] not in digits:

0 commit comments

Comments
 (0)