From 9977c06b0a099347edf1715db0252434a5f768a9 Mon Sep 17 00:00:00 2001 From: "loadrunner%betak.net" Date: Tue, 18 Sep 2001 03:12:03 +0000 Subject: [PATCH] bug 99253, Optimization on sort in pref-languages.js, patch by jrgm, r=jbetak, sr=blizzard, alecf --- .../prefwindow/resources/content/pref-languages.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xpfe/components/prefwindow/resources/content/pref-languages.js b/xpfe/components/prefwindow/resources/content/pref-languages.js index ccef690e6a9..527a196c709 100644 --- a/xpfe/components/prefwindow/resources/content/pref-languages.js +++ b/xpfe/components/prefwindow/resources/content/pref-languages.js @@ -200,7 +200,12 @@ function ReadAvailableLanguages() //} //if visible } //if accepted } //while - availLanguageDict.sort(); + availLanguageDict.sort( // sort on first element + function (a, b) { + if (a[0] < b[0]) return -1; + if (a[0] > b[0]) return 1; + return 0; + }); }