From 6942fd9a567743c5784c5445ee49c3a4fc1d3b48 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Wed, 27 Aug 2014 22:12:02 -0600 Subject: [PATCH] regexec.c: Simplify a short code section Two "if"s can be combined, leading to one fewer (unoptimized) tests --- regexec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/regexec.c b/regexec.c index b6d163e..f4bb069 100644 --- a/regexec.c +++ b/regexec.c @@ -7685,12 +7685,12 @@ S_reginclass(pTHX_ regexp * const prog, const regnode * const n, const U8* const match = TRUE; } else if (flags & ANYOF_LOCALE_FLAGS) { - if (flags & ANYOF_LOC_FOLD) { - if (ANYOF_BITMAP_TEST(n, PL_fold_locale[c])) { - match = TRUE; - } + if ((flags & ANYOF_LOC_FOLD) + && ANYOF_BITMAP_TEST(n, PL_fold_locale[c])) + { + match = TRUE; } - if (! match && ANYOF_POSIXL_TEST_ANY_SET(n)) { + else if (ANYOF_POSIXL_TEST_ANY_SET(n)) { /* The data structure is arranged so bits 0, 2, 4, ... are set * if the class includes the Posix character class given by -- 1.8.3.1