Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
use bitwise ops rather than B to check for numeric flags #2
This abuses the fact that bitwise ops change behavior based on the
We first us an & to shorten the input, so we don't end up operating on a
"0" & 0 -> 0
0 ^ 0 -> 0 (false)
Previous attempts to use this technique didn't include the & step to shorten the value, and were thus slower than using B for long strings.
This is a revision of PR #1, including a fix for perl < 5.14, as well as documenting the purpose of the checks better.