From: Karl Williamson Date: Thu, 27 Dec 2012 22:26:01 +0000 (-0700) Subject: regcomp.c: Use xor to save a test X-Git-Tag: upstream/5.20.0~4331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b3b4f852b741d64a2eec9695dfe61fe2a05c531;p=platform%2Fupstream%2Fperl.git regcomp.c: Use xor to save a test (Perhaps the C optimizer already figures this out.) --- diff --git a/regcomp.c b/regcomp.c index 9008ae7..35fd196 100644 --- 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--;