Tonttu
2e4e73a436
Rewrite TextFormatter.RemoveHotKeySpecifier
...
Uses stackalloc char buffer with fallback to rented array.
2025-03-17 16:17:46 +01:00
Tonttu
b6a5ca1d4e
Rewrite StringExtensions.ToString(IEnumerable<Rune>)
...
Appends rune chars to StringBuilder avoiding intermediate string allocation for each rune append.
2025-03-17 16:17:46 +01:00
Tonttu
aeffe3e36e
Add benchmark category to the TextFormatter benchmarks
2025-03-17 16:17:46 +01:00
Tonttu
662e745395
Rewrite TextFormatter.ReplaceCRLFWithSpace
...
Almost identical to the StripCRLF implementation.
2025-03-17 16:17:46 +01:00
Tonttu
7d317ba550
StripCRLF early exit when no newline to avoid StringBuilder allocation
2025-03-17 16:17:46 +01:00
Tonttu
40d4cab510
More varied text permutations for the StripCRLF benchmark
2025-03-17 16:17:46 +01:00
Tonttu
6f63dca591
Rewrite TextFormatter.StripCRLF
...
Uses StringBuilder and char span indexof search to reduce intermediate allocations.
The new implementation behaves slightly different compared to old implementation. In synthetic LFCR scenario it is correctly removed while the old implementation left the CR, which seems like an off-by-one error.
2025-03-17 16:17:46 +01:00