Changeset 12804


Ignore:
Timestamp:
Aug 30, 2011, 7:27:59 AM (10 years ago)
Author:
jordan
Message:

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

Location:
trunk/web/javascript
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/javascript/common.js

    r12801 r12804  
    129129}
    130130
    131 /**
    132  * @brief strcmp()-style compare useful for sorting
    133  */
    134 String.prototype.compareTo = function(that) {
    135         // FIXME: how to fold these two comparisons together?
    136         if (this < that) return -1;
    137         if (this > that) return 1;
    138         return 0;
    139 }
    140 
    141131/***
    142132****  Preferences
     
    177167        'filter': 'all',
    178168        'refresh_rate' : 5,
    179         'show_filter': true,
    180169        'sort_direction': 'ascending',
    181170        'sort_method': 'name',
  • trunk/web/javascript/torrent.js

    r12797 r12804  
    359359Torrent.compareByName = function(ta, tb)
    360360{
    361         return ta.getCollatedName().compareTo(tb.getCollatedName())
     361        return ta.getCollatedName().localeCompare(tb.getCollatedName())
    362362            || Torrent.compareById(ta, tb);
    363363};
Note: See TracChangeset for help on using the changeset viewer.