修訂 | 54b92759ddd4ff52ed4f302354414b486eef938b (tree) |
---|---|
時間 | 2009-03-30 00:08:00 |
作者 | henoheno <henoheno> |
Commiter | henoheno |
generate_trie_regex(): No need to check $char itself
@@ -1,6 +1,6 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | -// $Id: func.php,v 1.99 2009/03/29 03:04:07 henoheno Exp $ | |
3 | +// $Id: func.php,v 1.100 2009/03/29 15:08:00 henoheno Exp $ | |
4 | 4 | // Copyright (C) |
5 | 5 | // 2002-2007,2009 PukiWiki Developers Team |
6 | 6 | // 2001-2002 Originally written by yu-ji |
@@ -658,8 +658,9 @@ function generate_trie_regex(& $array, $_offset = 0, $_sentry = NULL, $_pos = 0) | ||
658 | 658 | |
659 | 659 | // How many continuous keys have the same letter |
660 | 660 | // at the same position? |
661 | - for ($i = $index; $i < $_sentry; $i++) | |
661 | + for ($i = $index + 1; $i < $_sentry; $i++) { | |
662 | 662 | if (mb_substr($array[$i], $_pos, 1) != $char) break; |
663 | + } | |
663 | 664 | |
664 | 665 | if ($index < ($i - 1)) { |
665 | 666 | // Some more keys found |