projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
899d20b
)
regcomp.c: Use xor to save a test
author
Karl Williamson
<public@khwilliamson.com>
Thu, 27 Dec 2012 22:26:01 +0000
(15:26 -0700)
committer
Karl Williamson
<public@khwilliamson.com>
Fri, 28 Dec 2012 17:38:56 +0000
(10:38 -0700)
(Perhaps the C optimizer already figures this out.)
regcomp.c
patch
|
blob
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
9008ae7
..
35fd196
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-11459,7
+11459,11
@@
parseit:
if (UCHARAT(RExC_parse) == '^') {
RExC_parse++;
n--;
- value = value == 'p' ? 'P' : 'p'; /* toggle */
+ /* toggle. (The rhs xor gets the single bit that
+ * differs between P and p; the other xor inverts just
+ * that bit) */
+ value ^= 'P' ^ 'p';
+
while (isSPACE(UCHARAT(RExC_parse))) {
RExC_parse++;
n--;