Repository navigation
Conversation
Each duplicate reference to a footnote restarted the search for a unique id at the first one, so N references to one footnote took O(N^2) time. Resume from the last id issued for that footnote instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Each duplicate reference to a footnote restarted the search for a unique id at the first one (
fnref:a, thenfnref2:a, ...), so N references to the same footnote took O(N²) time:"[^a]" * 4000(16 KB) takes 6.7 s to convert. This resumes from the last id issued for that footnote. Earlier ids are all still inused_refs, so the generated ids are unchanged. With the change the same input takes 0.17 s.AI Assistance Disclosure
No AI tools were used in preparing this PR.
AI tools were used and I have disclosed which ones, and have fully reviewed and verified their output.
AI tools were use to assist with the following:
Checklist