Commit e0cee862 authored by Christopher Rogers's avatar Christopher Rogers

Fixes a variable leak and simplifies low score filtration

Signed-off-by: 's avatarChristopher Rogers <chrissrogers@gmail.com>
parent e5cf1f25
......@@ -71,18 +71,13 @@
if (this.value) {
sections.hide();
// results are sorted by score in descending order
var tmpResults = index.search(this.value);
var results = [];
// remove low score matches
$.each(tmpResults, function (index, item) {
if (item.score >= 0.0001) results.push(item);
});
var results = index.search(this.value);
if (results.length) {
lastRef = null;
resetHeaderLocations();
var lastRef;
$.each(results, function (index, item) {
if (item.score <= 0.0001) return; // remove low-score results
var itemRef = item.ref;
$('#section-' + itemRef).show();
// headers must be repositioned in the DOM
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment