diff --git a/core/src/main/resources/org/teavm/backend/javascript/runtime.js b/core/src/main/resources/org/teavm/backend/javascript/runtime.js index d4b7b7e74..0a318d91c 100644 --- a/core/src/main/resources/org/teavm/backend/javascript/runtime.js +++ b/core/src/main/resources/org/teavm/backend/javascript/runtime.js @@ -24,11 +24,7 @@ function $rt_nextId() { return x; } function $rt_compare(a, b) { - var nanA = a != a; - var nanB = b != b; - if (nanA | nanB) return nanA - nanB; - if (a === 0 && b === 0) { a = 1 / a, b = 1 / b; } - return (a > b) - (a < b); + return a > b ? 1 : a < b ? -1 : a === b ? 0 : 1; } function $rt_isInstance(obj, cls) { return obj !== null && !!obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls);