1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-19 18:25:38 +00:00

(trunk web) use String.localeCompare() instead of rolling our own compareTo() function.

This commit is contained in:
Jordan Lee 2011-08-30 07:27:59 +00:00
parent af1d2b76c0
commit c44ce249d2
2 changed files with 1 additions and 12 deletions

View file

@ -128,16 +128,6 @@ String.prototype.trim = function () {
return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
/**
* @brief strcmp()-style compare useful for sorting
*/
String.prototype.compareTo = function(that) {
// FIXME: how to fold these two comparisons together?
if (this < that) return -1;
if (this > that) return 1;
return 0;
}
/***
**** Preferences
***/
@ -176,7 +166,6 @@ Prefs._Defaults =
{
'filter': 'all',
'refresh_rate' : 5,
'show_filter': true,
'sort_direction': 'ascending',
'sort_method': 'name',
'turtle-state' : false,

View file

@ -358,7 +358,7 @@ Torrent.compareById = function(ta, tb)
};
Torrent.compareByName = function(ta, tb)
{
return ta.getCollatedName().compareTo(tb.getCollatedName())
return ta.getCollatedName().localeCompare(tb.getCollatedName())
|| Torrent.compareById(ta, tb);
};
Torrent.compareByQueue = function(ta, tb)