Skip to content

Commit f9636e1

Browse files
Remove unused code in sort-alternatives (#421)
1 parent 4b20166 commit f9636e1

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

lib/rules/sort-alternatives.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import type {
1818
} from "regexp-ast-analysis"
1919
import {
2020
Chars,
21-
getFirstConsumedChar,
2221
hasSomeDescendant,
2322
canReorder,
2423
getLongestPrefix,
@@ -163,16 +162,6 @@ function sortAlternatives(
163162
alternatives: Alternative[],
164163
flags: ReadonlyFlags,
165164
): void {
166-
const firstChars = new Map<Alternative, number>()
167-
for (const a of alternatives) {
168-
const chars = getFirstConsumedChar(a, "ltr", flags)
169-
const char =
170-
chars.empty || chars.char.isEmpty
171-
? Infinity
172-
: chars.char.ranges[0].min
173-
firstChars.set(a, char)
174-
}
175-
176165
alternatives.sort((a, b) => {
177166
const prefixDiff = compareCharSetStrings(
178167
getLongestPrefix(a, "ltr", flags, LONGEST_PREFIX_OPTIONS),

0 commit comments

Comments
 (0)