mirror of https://github.com/gorhill/uBlock.git
this fixes bad sorting of hostnames on Pale Moon
This commit is contained in:
parent
da6c7b8b5e
commit
ba20843e07
|
@ -181,11 +181,16 @@ var formatNumber = function(count) {
|
|||
var rulekeyCompare = function(a, b) {
|
||||
var ha = a.slice(2, a.indexOf(' ', 2));
|
||||
if ( !reIP.test(ha) ) {
|
||||
ha = hostnameToSortableTokenMap[ha] || '';
|
||||
ha = hostnameToSortableTokenMap[ha] || ' ';
|
||||
}
|
||||
var hb = b.slice(2, b.indexOf(' ', 2));
|
||||
if ( !reIP.test(hb) ) {
|
||||
hb = hostnameToSortableTokenMap[hb] || '';
|
||||
hb = hostnameToSortableTokenMap[hb] || ' ';
|
||||
}
|
||||
var ca = ha.charCodeAt(0),
|
||||
cb = hb.charCodeAt(0);
|
||||
if ( ca !== cb ) {
|
||||
return ca - cb;
|
||||
}
|
||||
return ha.localeCompare(hb);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue