Skip to content

Commit 3a33b93

Browse files
committed
fix: fast path for compareIdentifiers when num
1 parent 2471d75 commit 3a33b93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/identifiers.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
const numeric = /^[0-9]+$/
44
const compareIdentifiers = (a, b) => {
5+
if (typeof a === 'number' && typeof b === 'number') {
6+
return a === b ? 0 : a < b ? -1 : 1
7+
}
8+
59
const anum = numeric.test(a)
610
const bnum = numeric.test(b)
711

0 commit comments

Comments
 (0)