Permalink
Browse files

improve string ranking

  • Loading branch information...
1 parent 516101b commit fc545ea6da22ec7ca2d0a7a2cfa16135fa219a7c @niklasb committed Jan 22, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/completion.js
View
@@ -29,7 +29,7 @@ var completion = (function() {
str = self.normalize(str);
var sum = 0;
// only iterate over slices of the query starting at an offset up to 10 to save resources
- for (var start = 0; start < 10; ++start) {
+ for (var start = 0; start < 20; ++start) {
for (var i = query.length; i >= start; --i) {
if (str.indexOf(query.slice(start, i)) >= 0) {
sum += i - start;

0 comments on commit fc545ea

Please sign in to comment.