reginclass: Remove redundant test
authorKarl Williamson <public@khwilliamson.com>
Sun, 31 Oct 2010 19:31:13 +0000 (13:31 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 31 Oct 2010 23:16:41 +0000 (16:16 -0700)
The previous re-ordering of this function makes it clear that this test
doesn't do anything.  It is testing the charclass bitmap, but that was
already done in the re-ordered block from a previous commit, so if it
didn't succeed there, it won't succeed here.

In fact, trying to understand why this code was here was what led me to
figure out that it wasn't, and that things could be sped up by doing the
reordering.

regexec.c

index 3ca8451..2c9b852 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -6296,13 +6296,10 @@ S_reginclass(pTHX_ const regexp * const prog, register const regnode * const n,
     /* If the bitmap didn't (or couldn't) match, and something outside the
      * bitmap could match, try that */
     if (! match && utf8_target || (flags & ANYOF_UNICODE)) {
-       if (utf8_target && !ANYOF_RUNTIME(n)) {
-           if (c < 256 && ANYOF_BITMAP_TEST(n, c))
-               match = TRUE;
-       }
-       if (!match && utf8_target && (flags & ANYOF_UNICODE_ALL) && c >= 256)
+       if (utf8_target && (flags & ANYOF_UNICODE_ALL) && c >= 256) {
            match = TRUE;
-       if (!match) {
+       }
+       else {
            AV *av;
            SV * const sw = regclass_swash(prog, n, TRUE, 0, (SV**)&av);