Bug 700389 - Simplify sortByTotalScore. r=zpao

This commit is contained in:
Felix Fung 2011-11-07 12:08:04 -08:00
parent 8e49acb81a
commit b6126dbd91

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)