diff options
| author | Jez Ng | 2012-11-03 13:26:28 -0400 |
|---|---|---|
| committer | Jez Ng | 2012-11-03 13:28:26 -0400 |
| commit | 523e300738c6d7fd730377c9cde875ac0759da00 (patch) | |
| tree | 3ee2c2299f5b583f43c64283336f584972fa3eaa /background_scripts/completion.coffee | |
| parent | c5744b9ac228d2943a1ba77cc3e8fc91aeab85a7 (diff) | |
| download | vimium-523e300738c6d7fd730377c9cde875ac0759da00.tar.bz2 | |
Minor touchups.
Diffstat (limited to 'background_scripts/completion.coffee')
| -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 |
