Replace hot Tokenizer loop with a mathematical expression
Replace hot Tokenizer loop with a mathematical expression

This piece of code is very hot, executed thousands, possibly millions of times.

I found this when I benchmarked our custom sniffs. The replaceTabsInToken() method is consistently reported as one of the absolute hottest ones. I looked at the method and was wondering why this particular piece is a loop when it can be a mathematical expression. According to my micro-benchmark (only measuring the changed piece) it's about twice as fast now. This will probably not have much of an effect in a real-world scenario. Still I find it worth it.
stronk7/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,stronk7/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,jrfnl/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer,stronk7/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer,squizlabs/PHP_CodeSniffer