From 63d5306fa49ad719afbadcb24f807949f30d3fd0 Mon Sep 17 00:00:00 2001 From: Iain Ireland Date: Wed, 16 Sep 2026 10:07:54 -0700 Subject: [PATCH] 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. --- cdjs/call_sign.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cdjs/call_sign.js b/cdjs/call_sign.js index e83ed8bf..ba46250e 100644 --- a/cdjs/call_sign.js +++ b/cdjs/call_sign.js @@ -28,7 +28,13 @@ function CallSign(value) { } CallSign.prototype.compareTo = function(other) { - return this._value.localeCompare(other._value); + if (this._value < other._value) { + return -1; + } else if (this._value > other._value) { + return 1; + } else { + return 0; + } } CallSign.prototype.toString = function() {