Skip to content

Commit cee195c

Browse files
committed
Fix out of range warning
1 parent b36f858 commit cee195c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/BoggleSolver.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public function loadDict()
7070

7171
for ($i = 0; $i < $wordLen; $i++) {
7272
$letter = $word[$i];
73-
if ($letter == 'Q' && isset($words[$i + 1]) && $word[$i + 1] == 'U') {
74-
$letter = 'Qu';
75-
$i++;
73+
if ($letter == 'Q' && isset($words[$i + 1])) {
74+
if ($word[$i + 1] == 'U') {
75+
$letter = 'Qu';
76+
$i++;
77+
}
7678
}
7779
if (!isset($ptr[$letter])) {
7880
$ptr[$letter] = array();

0 commit comments

Comments
 (0)