This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Don't repeat macro definition
authorKarl Williamson <khw@cpan.org>
Fri, 24 Apr 2020 18:04:34 +0000 (12:04 -0600)
committerKarl Williamson <khw@cpan.org>
Sun, 9 Aug 2020 04:39:41 +0000 (22:39 -0600)
Use a macro from within another macro instead of repeating the expansion
of it.

regcomp.c

index 9fdc5e5..addf375 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -370,8 +370,7 @@ struct RExC_state_t {
         RExC_naughty += RExC_naughty / (exp) + (add)
 
 #define        ISMULT1(c)      ((c) == '*' || (c) == '+' || (c) == '?')
-#define        ISMULT2(s)      ((*s) == '*' || (*s) == '+' || (*s) == '?' || \
-       ((*s) == '{' && regcurly(s)))
+#define        ISMULT2(s)      (ISMULT1(*s) || ((*s) == '{' && regcurly(s)))
 
 /*
  * Flags to be passed up and down.