Skip to content

Commit

Permalink
AGI: Fix predictive input binary search
Browse files Browse the repository at this point in the history
Note that there are still issues with this input mode. If the binary
search hits a prefix match before finding the full match, it won't
recognize the full match. (Example: typing "buy" will show "buz"
because it's aiming for "buzzard" without realizing "buy" exists.)
(cherry picked from commit 41ba243)
  • Loading branch information
wjp committed Jan 6, 2012
1 parent 4a0dc29 commit 51b354d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion engines/agi/predictive.cpp
Expand Up @@ -566,7 +566,7 @@ bool AgiEngine::matchWord() {
int hi = _predictiveDictLineCount - 1;
int lo = 0;
int line = 0;
while (lo < hi) {
while (lo <= hi) {
line = (lo + hi) / 2;
int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
if (cmpVal > 0)
Expand Down

0 comments on commit 51b354d

Please sign in to comment.