Skip to content

Commit 3b12c0d

Browse files
committed
Simplify
1 parent 5e12374 commit 3b12c0d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/tailwindcss/src/utils/compare.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,15 @@ export function compare(a: string, z: string) {
3333
zCode = z.charCodeAt(++zEnd)
3434
} while (zCode >= ZERO && zCode <= NINE)
3535

36-
if (aValue - zValue) {
37-
return aValue - zValue
38-
}
36+
if (aValue - zValue) return aValue - zValue
3937

4038
let aNumber = a.slice(i, aEnd)
4139
let zNumber = z.slice(i, zEnd)
4240

4341
// Fallback case if numbers are the same but the string representation
4442
// is not. Fallback to string sorting. E.g.: `0123` vs `123`
45-
if (aNumber < zNumber) {
46-
return -1
47-
} else if (aNumber > zNumber) {
48-
return 1
49-
} else {
50-
continue
51-
}
43+
if (aNumber < zNumber) return -1
44+
if (aNumber > zNumber) return 1
5245
}
5346

5447
// Continue if the characters are the same

0 commit comments

Comments
 (0)