Skip to content

Commit 3ea0992

Browse files
samarthsehgal97cclauss
authored andcommitted
Update aho-corasick.py (#1457)
1 parent 182062d commit 3ea0992

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

strings/aho-corasick.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def set_fail_transitions(self):
5454
self.adlist[child]["fail_state"] = self.find_next_state(
5555
state, self.adlist[child]["value"]
5656
)
57-
if self.adlist[child]["fail_state"] == None:
57+
if self.adlist[child]["fail_state"] is None:
5858
self.adlist[child]["fail_state"] = 0
5959
self.adlist[child]["output"] = (
6060
self.adlist[child]["output"]
@@ -71,7 +71,7 @@ def search_in(self, string):
7171
current_state = 0
7272
for i in range(len(string)):
7373
while (
74-
self.find_next_state(current_state, string[i]) == None
74+
self.find_next_state(current_state, string[i]) is None
7575
and current_state != 0
7676
):
7777
current_state = self.adlist[current_state]["fail_state"]

0 commit comments

Comments
 (0)