We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 182062d commit 3ea0992Copy full SHA for 3ea0992
strings/aho-corasick.py
@@ -54,7 +54,7 @@ def set_fail_transitions(self):
54
self.adlist[child]["fail_state"] = self.find_next_state(
55
state, self.adlist[child]["value"]
56
)
57
- if self.adlist[child]["fail_state"] == None:
+ if self.adlist[child]["fail_state"] is None:
58
self.adlist[child]["fail_state"] = 0
59
self.adlist[child]["output"] = (
60
self.adlist[child]["output"]
@@ -71,7 +71,7 @@ def search_in(self, string):
71
current_state = 0
72
for i in range(len(string)):
73
while (
74
- self.find_next_state(current_state, string[i]) == None
+ self.find_next_state(current_state, string[i]) is None
75
and current_state != 0
76
):
77
current_state = self.adlist[current_state]["fail_state"]
0 commit comments