Skip to content

Commit

Permalink
Merge pull request codeplea#3 from swumao/bugfix_php_error
Browse files Browse the repository at this point in the history
Fix bug codeplea#2
  • Loading branch information
codeplea authored Sep 19, 2018
2 parents 624d0f0 + 0df6a23 commit 64d696b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ahocorasick.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function search($haystack) {
for ($i = 0; $i < strlen($haystack); ++$i) {
$c = $haystack[$i];

while(!isset($nodes[$n][$c]) && $n) {
while(!in_array($c, array_keys($nodes[$n]), true) && $n) {
$n = $nodes[$n][1];
if ($n === null) die();
}
Expand Down

0 comments on commit 64d696b

Please sign in to comment.