Closed eduncan911 closed 9 years ago
since u have merged the other one (for docs), I can resubmit this PR with the conflicts resolved if u like?
there ya go. pulled in the doc updates and resolved the conflicts.
ready to merge
Other pull request was merged because it is trivial, I'd like some time to think about this change.
no problem. all i did was move them out of local scope and into the package scope. i also added benchmark tests for the affected methods.
all existing tests passed, indicating that no logic was changed or broken. i also verified there was a test for each method affected by this change.
MustCompile is an extra safety measure ensuring the regex is valid before the app runs.
Thanks for this. I've merged your changes with minor tweaks - I prefer to keep the pkg globals inline above the functions which use them, so that it's clear where they are used, and I wanted the global names a bit clearer.
Instantiating regex is expensive. Should always keep it global for speed. This PR improves performance over 2x times.
Original speed:
Improvements in this pull request:
Benchmarked on Go1.4.1