You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: avoid ToCharArray allocations in TextConversions, HtmlParser, HtmlCssSelectors, HtmlOperations
- TextConversions.RemoveAdorners: replace ToCharArray()+Array.filter with a
StringBuilder loop; avoids two intermediate char[] allocations (ToCharArray
result + filtered result) on the hot path for every number/date parse attempt
- HtmlParser: replace ToCharArray()|>Array.rev string reversal with Array.init
using direct index arithmetic; avoids ToCharArray allocation for malformed
end-tag detection (e.g. <li></il>)
- HtmlCssSelectors.StartsWith: remove ToCharArray(); compare list against string
directly via Seq.compareWith (string is IEnumerable<char>)
- HtmlCssSelectors.TokenStr: replace ToCharArray()|>Array.toList with List.ofSeq
- HtmlCssSelectors.Tokenize: replace ToCharArray()|>Array.toList with List.ofSeq
- HtmlOperations AttributeContainsPrefix: remove ToCharArray() before Seq.skipWhile
since string is already IEnumerable<char>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments