mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-07 21:42:25 +00:00
[PR #394] Use HashSet<T> instead of Dictionary<TKey, TValue> in CharacterMap<T> #993
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 aHashSet<char>. The dictionary used to be indexed three or four times per iteration though the loop, the hashSet is indexed once per iteration.