assert,util: improve unequal number comparison performance · nodejs/node@696b5f8 · GitHub
Skip to content

Commit 696b5f8

Browse files
BridgeARaduh95
authored andcommitted
assert,util: improve unequal number comparison performance
This improves the performance to compare unequal numbers while doing a deep equal comparison. Comparing for NaN is faster by checking `variable !== variable` than by using `Number.isNaN()`. PR-URL: #57619 Reviewed-By: Jordan Harband <ljharb@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent 775ee4d commit 696b5f8

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

lib/internal/util/comparisons.js

Lines changed: 9 additions & 5 deletions

0 commit comments

Comments
 (0)