Please sign in to comment.
Avoid constructing a Regexp when splitting a String with negative limit
When splitting a string using a String pattern, we don't want to turn it into a Regexp unless we absolutely have to. Prior to this change, passing a negative limit into String#split would have forced this conversion and incurred a high performance cost as a result. Running the benchmark for this particular case shows a three-fold improvement.
- Loading branch information...