Skip to content

Commit 63d5306

Browse files
committed
Don't use localeCompare in CallSign.prototype.compareTo
This produces the same results as localeCompare for every call in a run of cdjs, without encouraging engines to optimize silly uses of localeCompare.
1 parent de88e36 commit 63d5306

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎cdjs/call_sign.js‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ function CallSign(value) {
2828
}
2929

3030
CallSign.prototype.compareTo = function(other) {
31-
return this._value.localeCompare(other._value);
31+
if (this._value < other._value) {
32+
return -1;
33+
} else if (this._value > other._value) {
34+
return 1;
35+
} else {
36+
return 0;
37+
}
3238
}
3339

3440
CallSign.prototype.toString = function() {

0 commit comments

Comments
 (0)