This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Collapse two identical cases in a switch
authorKarl Williamson <public@khwilliamson.com>
Thu, 13 Dec 2012 16:09:17 +0000 (09:09 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 22 Dec 2012 18:11:29 +0000 (11:11 -0700)
regcomp.c

index 9ae03c7..e435876 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -12063,6 +12063,8 @@ parseit:
                    break;
                case ANYOF_LOWER:
                case ANYOF_NLOWER:
+               case ANYOF_UPPER:
+               case ANYOF_NUPPER:
                 {   /* These require special handling, as they differ under
                       folding, matching Cased there (which in the ASCII range
                       is the same as Alpha */
@@ -12111,37 +12113,6 @@ parseit:
                     DO_N_POSIX(ret, namedclass, posixes,
                                             PL_Posix_ptrs[classnum], PL_XPerlSpace);
                    break;
-               case ANYOF_UPPER:   /* Same as LOWER, above */
-               case ANYOF_NUPPER:
-               {
-                   SV* ascii_source;
-                   SV* l1_source;
-                   const char *Xname;
-                    SV* swash;
-
-                   if (FOLD && ! LOC) {
-                       ascii_source = PL_Posix_ptrs[_CC_ALPHA];
-                       l1_source = PL_L1Cased;
-                       Xname = "Cased";
-                        swash = NULL;
-                   }
-                   else {
-                       ascii_source = PL_Posix_ptrs[classnum];
-                       l1_source = PL_L1Posix_ptrs[classnum];
-                       Xname = swash_property_names[classnum];
-                        swash = PL_utf8_swash_ptrs[classnum];
-                   }
-                   if (namedclass % 2) {   /* If odd, is the complemented version */
-                       DO_N_POSIX_LATIN1_ONLY_KNOWN(ret, namedclass,
-                        posixes, ascii_source, l1_source, Xname, listsv,
-                        runtime_posix_matches_above_Unicode);
-                   }
-                   else {
-                       DO_POSIX_LATIN1_ONLY_KNOWN(ret, namedclass, posixes,
-                                    ascii_source, swash, l1_source, Xname, listsv);
-                   }
-                   break;
-               }
                case ANYOF_VERTWS:
                    /* For these, we use the cp_list, as /d doesn't make a
                     * difference in what these match.  There would be problems