Please sign in to comment.
Optimize Splitter in the matching delimiter regexp case
Avoid calling MatchData#captures in a tight loop unless there are in fact any captures. Also includes a few micro-optimisations, like using Array#concat instead of Array#push with a splat, and favouring Array#at(-1) over Array#last when we know the array is not empty. Overall, this shows an almost three-fold improvement in the relevant benchmark.
- Loading branch information...