From 6279735b4d202a641562d3c25533d707646345a7 Mon Sep 17 00:00:00 2001 From: Felix Fung Date: Mon, 7 Nov 2011 12:08:04 -0800 Subject: [PATCH] Bug 700389 - Simplify sortByTotalScore. r=zpao --- toolkit/components/satchel/nsFormAutoComplete.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index be2142c33d1..4cfe0a2af8b 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -163,9 +163,7 @@ FormAutoComplete.prototype = { */ autoCompleteSearch : function (aInputName, aUntrimmedSearchString, aField, aPreviousResult) { function sortBytotalScore (a, b) { - let x = a.totalScore; - let y = b.totalScore; - return ((x > y) ? -1 : ((x < y) ? 1 : 0)); + return b.totalScore - a.totalScore; } if (!this._enabled)