[PR #394] Use HashSet<T> instead of Dictionary<TKey, TValue> in CharacterMap<T> #993

Closed
opened 2026-01-29 14:48:16 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/xoofx/markdig/pull/394

State: closed
Merged: Yes


The CharacterMap<T> constructor counts the occurrence of each opening character, but doesn't use the actual count.

This PR replaces the Dictionary<char, int> by a HashSet<char>. The dictionary used to be indexed three or four times per iteration though the loop, the hashSet is indexed once per iteration.

**Original Pull Request:** https://github.com/xoofx/markdig/pull/394 **State:** closed **Merged:** Yes --- The `CharacterMap<T>` constructor counts the occurrence of each opening character, but doesn't use the actual count. This PR replaces the `Dictionary<char, int>` by a `HashSet<char>`. The dictionary used to be indexed three or four times per iteration though the loop, the hashSet is indexed once per iteration.
claunia added the pull-request label 2026-01-29 14:48:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#993