Skip to content

Commit 1e208b7

Browse files
authoredDec 10, 2020
Properly set CharsetGroupProber.state to FOUND_IT (#203)
Throughout the rest of the chardet code we assume that FOUND_IT means we can stop looking. Previously the CharsetGroupProber did not set its state appropriately when a child prober returned FOUND_IT. This substantially speeds up the chardet for most encodings. Fixes #202
1 parent a9286f7 commit 1e208b7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎chardet/charsetgroupprober.py

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def feed(self, byte_str):
7373
continue
7474
if state == ProbingState.FOUND_IT:
7575
self._best_guess_prober = prober
76+
self._state = ProbingState.FOUND_IT
7677
return self.state
7778
elif state == ProbingState.NOT_ME:
7879
prober.active = False

0 commit comments

Comments
 (0)
Please sign in to comment.