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:
mossroy 2013-07-08 13:59:27 +02:00
parent 7eeafe4d84
commit 63aec21065

View File

@ -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);