Skip to content

Commit

Permalink
sped up for inputs with no queries
Browse files Browse the repository at this point in the history
  • Loading branch information
riklomas committed Sep 28, 2010
1 parent 8911aec commit f984f7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions jquery.quicksearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@

this.go = function () {

var i = 0, noresults = true, query = options.prepareQuery(val);
var i = 0,
noresults = true,
query = options.prepareQuery(val),
val_empty = (val.replace(' ', '').length === 0);

var rowcache_length = rowcache.length;
for (var i = 0; i < rowcache_length; i++)
{
if (options.testQuery(query, cache[i], rowcache[i])) {
for (var i = 0, len = rowcache.length; i < len; i++) {
if (val_empty || options.testQuery(query, cache[i], rowcache[i])) {
options.show.apply(rowcache[i]);
noresults = false;
} else {
Expand Down

0 comments on commit f984f7f

Please sign in to comment.