Bug 700389 - Simplify sortByTotalScore. r=zpao

This commit is contained in:
Felix Fung 2011-11-07 12:08:04 -08:00
parent 351eedb003
commit 75b4a80ee3

View File

@ -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)