Re-order some flag bits to avoid potential branches
authorKarl Williamson <public@khwilliamson.com>
Tue, 26 Nov 2013 03:12:33 +0000 (20:12 -0700)
committerKarl Williamson <public@khwilliamson.com>
Tue, 31 Dec 2013 15:27:21 +0000 (08:27 -0700)
commit5dbb0c086b3025f9e48420fe3db4747e977ecfd6
treefdd53dbb8433d6816bc177de918015e4a1b6de49
parente9b08962fbb05ece388fd5076686a7edfd6dbe3b
Re-order some flag bits to avoid potential branches

The ANYOF_INVERT flag is used in every single pattern match of
[bracketed character classes].  With backtracking, this can be a huge
number.  All the other flags' uses pale by comparison.  I noticed that
by making it the lowest bit, we don't have to use CBOOL, as the only
possibilities are 0 and 1.  cBOOL hopefully will be optimized away, but
not always.  This commit reorders some of the flag bits to make this one
the lowest, and adds a compile check to make sure it isn't inadvertently
changed.
regcomp.h
regexec.c