-
Tim Hunt authored
These changes give about a 10% speed-up in this function. The significant changes are: 1. Simplify the if logic to remove unnecssary cases. 2. Dont pass default argument values to htmlspecialchars, just using the defaults is faster. 3. I can confirm that /i regex is faster than the equivalent regex without the i. I also added more unit tests to test the edge cases.
Tim Hunt authoredThese changes give about a 10% speed-up in this function. The significant changes are: 1. Simplify the if logic to remove unnecssary cases. 2. Dont pass default argument values to htmlspecialchars, just using the defaults is faster. 3. I can confirm that /i regex is faster than the equivalent regex without the i. I also added more unit tests to test the edge cases.
Loading