The Substring() method in .NET performs horribly compared to Java. So, the Lookahead() method was modified to return ReadOnlySpan<char> so it can be sliced without allocating substrings.
On .NET Framework 4.0, we work around this by passing in the buffer instead of calling Lookahead().
The
Substring()
method in .NET performs horribly compared to Java. So, theLookahead()
method was modified to returnReadOnlySpan<char>
so it can be sliced without allocating substrings.On .NET Framework 4.0, we work around this by passing in the buffer instead of calling
Lookahead()
.