diff options
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion.coffee | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index cf946b06..9e12d497 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -257,7 +257,7 @@ RankingUtils = regexp = RegexpCache.get(term) matchedTerm = false for thing in things - matchedTerm = matchedTerm || (thing?.match && thing.match regexp) + matchedTerm ||= thing.match regexp return false unless matchedTerm true @@ -268,8 +268,8 @@ RankingUtils = titleScore = 0.0 for term in queryTerms queryLength += term.length - urlScore += 1 if RankingUtils.matches [term], url - titleScore += 1 if RankingUtils.matches [term], title + urlScore += 1 if url && RankingUtils.matches [term], url + titleScore += 1 if title && RankingUtils.matches [term], title urlScore = urlScore / queryTerms.length urlScore = urlScore * RankingUtils.normalizeDifference(queryLength, url.length) if title |
