Skip to content

Commit

Permalink
Simplify getNextLabelNum
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinovantes committed Aug 21, 2024
1 parent 4b8e5a4 commit 0b90515
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Parser/Resolver/SimpleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,11 @@ export class SimpleNameResolver {
const registerAutoLabelNums = () => {
const usedLabelNums = new Set<number>()
let autoLabelNumCounter = 1

const getNextLabelNum = (): number => {
let labelNum = autoLabelNumCounter++
while (usedLabelNums.has(labelNum)) {
labelNum++
while (usedLabelNums.has(autoLabelNumCounter)) {
autoLabelNumCounter++
}
return labelNum
return autoLabelNumCounter
}

// 1. Register all manual footnotes
Expand Down

0 comments on commit 0b90515

Please sign in to comment.