-
- Downloads
Improve performance of StringStream with long lines (match)
StringString.prototype.match(<string>) may do a lot of unnecessary work: - If it is caseInsensitive it was calling toLowerCase on the entire string. - It did an indexOf search through the string for a pattern, but only cared if the string started with that pattern. Because a string pattern has a fixed length, we only need to run toLowerCase on a small substring of the stream, and we only compare this small substring to the pattern.
Loading
Please register or sign in to comment