This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Remove unnecessary cBOOLs
authorKarl Williamson <public@khwilliamson.com>
Tue, 28 Dec 2010 17:40:56 +0000 (10:40 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 17 Jan 2011 02:13:24 +0000 (19:13 -0700)
These functions already return a boolean.

regexec.c

index a584add..4416d69 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1533,7 +1533,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
                    U8 * const r = reghop3((U8*)s, -1, (U8*)PL_bostr);
                    tmp = utf8n_to_uvchr(r, UTF8SKIP(r), 0, UTF8_ALLOW_DEFAULT);
                }
-               tmp = cBOOL(FLAGS(c) != REGEX_LOCALE_CHARSET ?
+               tmp = (FLAGS(c) != REGEX_LOCALE_CHARSET ?
                        isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp)));
                LOAD_UTF8_CHARCLASS_ALNUM();
                REXEC_FBC_UTF8_SCAN(
@@ -1548,7 +1548,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
            }
             else {  /* Not utf8 */
                tmp = (s != PL_bostr) ? UCHARAT(s - 1) : '\n';
-                tmp = cBOOL((FLAGS(c) == REGEX_LOCALE_CHARSET)
+                tmp = ((FLAGS(c) == REGEX_LOCALE_CHARSET)
                             ? isALNUM_LC(tmp)
                             : (isWORDCHAR_L1(tmp)
                                && (isASCII(tmp) || (FLAGS(c) == REGEX_UNICODE_CHARSET))));
@@ -1578,7 +1578,7 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
                    U8 * const r = reghop3((U8*)s, -1, (U8*)PL_bostr);
                    tmp = utf8n_to_uvchr(r, UTF8SKIP(r), 0, UTF8_ALLOW_DEFAULT);
                }
-               tmp = cBOOL(FLAGS(c) != REGEX_LOCALE_CHARSET ?
+               tmp = (FLAGS(c) != REGEX_LOCALE_CHARSET ?
                        isALNUM_uni(tmp) : isALNUM_LC_uvchr(UNI_TO_NATIVE(tmp)));
                LOAD_UTF8_CHARCLASS_ALNUM();
                REXEC_FBC_UTF8_SCAN(
@@ -1591,12 +1591,12 @@ S_find_byclass(pTHX_ regexp * prog, const regnode *c, char *s,
            }
            else {
                tmp = (s != PL_bostr) ? UCHARAT(s - 1) : '\n';
-                tmp = cBOOL((FLAGS(c) == REGEX_LOCALE_CHARSET)
+                tmp = ((FLAGS(c) == REGEX_LOCALE_CHARSET)
                             ? isALNUM_LC(tmp)
                             : (isWORDCHAR_L1(tmp)
                                && (isASCII(tmp) || (FLAGS(c) == REGEX_UNICODE_CHARSET))));
                REXEC_FBC_SCAN(
-                   if (tmp == ! cBOOL(
+                   if (tmp == ! (
                             (FLAGS(c) == REGEX_LOCALE_CHARSET)
                             ? isALNUM_LC(*s)
                             : (isWORDCHAR_L1((U8) *s)