[PR #531] A handful of codegen improvements #1102

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

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

State: closed
Merged: Yes


  • Added a PeekChar() overload of PeekChar(int) to ICharIterator. This method was already present on StringSlice, but since it was missing on the interface, callers were often binding to the slower overload
  • Added SkipChar to ICharIterator
  • Replaced CurrentCharacter == '\0' and Length == 0 with faster IsEmpty checks
  • Avoided a bunch of struct copies in StringLineGroup
  • Changed the NewLine.Length() to a bit operation
  • Simplified/optimized logic in HtmlHelper
  • Avoided the ToUtf32 iterator allocations in Globalization extension
**Original Pull Request:** https://github.com/xoofx/markdig/pull/531 **State:** closed **Merged:** Yes --- - Added a `PeekChar()` overload of `PeekChar(int)` to `ICharIterator`. This method was already present on `StringSlice`, but since it was missing on the interface, callers were often binding to the slower overload - Added `SkipChar` to `ICharIterator` - Replaced `CurrentCharacter == '\0'` and `Length == 0` with faster `IsEmpty` checks - Avoided a bunch of struct copies in `StringLineGroup` - Changed the `NewLine.Length()` to a bit operation - Simplified/optimized logic in `HtmlHelper` - Avoided the `ToUtf32` iterator allocations in Globalization extension
claunia added the pull-request label 2026-01-29 14:49:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1102