summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-12-31 10:00:55 -0700
committerKarl Williamson <public@khwilliamson.com>2012-12-31 11:03:29 -0700
commitf16cee58db950a496b57c484182664be6e57ae9a (patch)
tree05bce2802e927cb831e938d5ca95800b5329f6d2 /regcomp.c
parentae631a89af5d7101feb886994a85f1964cd6a8a2 (diff)
downloadperl-f16cee58db950a496b57c484182664be6e57ae9a.tar.gz
regcomp.c: Collapse switch cases
These cases differ only in that the union is of the complement in one of them. There is a function that provides both possibilities.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/regcomp.c b/regcomp.c
index 6d64c3165a..d88dcb9d51 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11920,8 +11920,8 @@ parseit:
namedclass % 2, /* Complement if odd (NASCII) */
&posixes);
break;
-
case ANYOF_HORIZWS:
+ case ANYOF_NHORIZWS:
/* For these, we use the cp_list, as neither /d nor /l make
* a difference in what these match. There would be
* problems if these characters had folds other than
@@ -11930,19 +11930,14 @@ parseit:
* It turns out that \h is just a synonym for XPosixBlank */
classnum = _CC_BLANK;
/* FALL THROUGH */
-
case ANYOF_VERTWS:
- _invlist_union(cp_list, PL_XPosix_ptrs[classnum], &cp_list);
- break;
-
- case ANYOF_NHORIZWS:
- classnum = _CC_BLANK;
- /* FALL THROUGH */
-
case ANYOF_NVERTWS:
- _invlist_union_complement_2nd(cp_list,
- PL_XPosix_ptrs[classnum],
- &cp_list);
+ _invlist_union_maybe_complement_2nd(
+ cp_list,
+ PL_XPosix_ptrs[classnum],
+ namedclass % 2, /* Complement if odd
+ (NHORIZWS, NVERTWS) */
+ &cp_list);
break;
case ANYOF_UNIPROP: /* this is to handle \p and \P */