AGI: Fix predictive input binary search
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 41ba2433f5
)
This commit is contained in:
parent
4a0dc293b5
commit
51b354d9a6
1 changed files with 1 additions and 1 deletions
|
@ -566,7 +566,7 @@ bool AgiEngine::matchWord() {
|
||||||
int hi = _predictiveDictLineCount - 1;
|
int hi = _predictiveDictLineCount - 1;
|
||||||
int lo = 0;
|
int lo = 0;
|
||||||
int line = 0;
|
int line = 0;
|
||||||
while (lo < hi) {
|
while (lo <= hi) {
|
||||||
line = (lo + hi) / 2;
|
line = (lo + hi) / 2;
|
||||||
int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
|
int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
|
||||||
if (cmpVal > 0)
|
if (cmpVal > 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue