From e051a21d2458b5ce83206336c2ee2d39013b8d1b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 31 Oct 2010 13:31:13 -0600 Subject: [PATCH] reginclass: Remove redundant test 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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/regexec.c b/regexec.c index 3ca8451..2c9b852 100644 --- 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); -- 1.8.3.1