Skip to content

Commit bcc53c1

Browse files
committed
perf: use O(1) hash set lookup for hyperlink scheme validation
Replace regex-based scheme validation with hash set lookup using array_fill_keys(). This is ~6x faster than the 5600+ character regex pattern for validating URI schemes against the 371 IANA schemes. The scheme list is duplicated from ExternalReferenceResolver to keep this PR independent. A consolidation PR can unify both after merging.
1 parent 6d2e211 commit bcc53c1

1 file changed

Lines changed: 399 additions & 9 deletions

File tree

  • packages/guides-restructured-text/src/RestructuredText/Parser

0 commit comments

Comments
 (0)