summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-01-04 21:12:07 -0700
committerKarl Williamson <public@khwilliamson.com>2014-01-09 14:05:43 -0700
commitce06237d0b462fe78ff975ab859a7140c2854fb0 (patch)
tree2d517bccbd502360fedc9c6c9126646f4c9b9039 /regcomp.c
parent169068d9015763c5a30a795ed92a4af2fdb3230d (diff)
downloadperl-ce06237d0b462fe78ff975ab859a7140c2854fb0.tar.gz
regcomp.c: Collapse two code branches
Previous commits have simplified things so these two if-then-else branches can be collapsed into one.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/regcomp.c b/regcomp.c
index 975b19b3c7..fee7ce4ad8 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -13471,6 +13471,9 @@ parseit:
}
}
else { /* Garden variety class */
+ SV** posixes_ptr = namedclass % 2 == 0
+ ? &posixes
+ : &nposixes;
/* The ascii range inversion list */
SV* ascii_source = PL_Posix_ptrs[classnum];
@@ -13486,22 +13489,12 @@ parseit:
}
#endif
- if (namedclass % 2 == 0) { /* A non-complemented class,
- like ANYOF_PUNCT */
- _invlist_union(posixes,
+ _invlist_union_maybe_complement_2nd(*posixes_ptr,
(AT_LEAST_ASCII_RESTRICTED)
? ascii_source
: *source_ptr,
- &posixes);
- }
- else { /* A complemented class, like ANYOF_NPUNCT */
- _invlist_union_complement_2nd(
- nposixes,
- (AT_LEAST_ASCII_RESTRICTED)
- ? ascii_source
- : *source_ptr,
- &nposixes);
- }
+ namedclass % 2 != 0,
+ posixes_ptr);
}
continue; /* Go get next character */
}