mirror of
https://github.com/kiwix/kiwix-js.git
synced 2025-09-22 12:01:15 -04:00
If we find the exact title when doing the binary search, it's no use searching more.
It's a small optimization.
This commit is contained in:
parent
7eeafe4d84
commit
63aec21065
@ -228,7 +228,14 @@ define(function(require) {
|
||||
lo = mid + newLineIndex - 1;
|
||||
}
|
||||
else {
|
||||
if (comparison > 0) {
|
||||
hi = mid;
|
||||
}
|
||||
else {
|
||||
// We found the exact title
|
||||
callbackFunction(mid + startIndex - 15);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
currentLocalArchiveInstance.recursivePrefixSearch(reader, normalizedPrefix, lo, hi, callbackFunction);
|
||||
|
Loading…
x
Reference in New Issue
Block a user