Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QA: remove some unnecessary micro-optimizations
While it is not a bad thing to optimize for performance, some micro-optimizations, like saving information to a function local `static` variable, should only be done when the trade-off is worth it. Having the function local `static` variable will often prevent code coverage from being recorded correctly for the code as the code for setting the static will only be run when the function is first called, which may not be in the dedicated test for the function, so it makes code coverage recording highly dependant on the order in which tests are run. In these three cases, I do not think this trade-off is worth it as these are a) not the most popular functions, b) true micro-optimizations which only effectively save one fast PHP native `version_compare()` call.
- Loading branch information
Showing
3 changed files
with
7 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters