A little reodering of the switch statement in Perl_regdupe makes a
authorNicholas Clark <nick@ccl4.org>
Sun, 26 Nov 2006 20:52:49 +0000 (20:52 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 26 Nov 2006 20:52:49 +0000 (20:52 +0000)
smaller executable.

p4raw-id: //depot/perl@29390

regcomp.c

index 80b8da1..bfcbd6b 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -8697,11 +8697,9 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param)
                   see also regcomp.h and pregfree() */
            case 's':
            case 'S':
+           case 'p': /* actually an AV, but the dup function is identical.  */
                d->data[i] = sv_dup_inc((SV *)ri->data->data[i], param);
                break;
-           case 'p':
-               d->data[i] = av_dup_inc((AV *)ri->data->data[i], param);
-               break;
            case 'f':
                /* This is cheating. */
                Newx(d->data[i], 1, struct regnode_charclass_class);
@@ -8716,14 +8714,13 @@ Perl_regdupe(pTHX_ const regexp *r, CLONE_PARAMS *param)
                d->data[i] = (void*)OpREFCNT_inc((OP*)ri->data->data[i]);
                OP_REFCNT_UNLOCK;
                break;
-           case 'n':
-               d->data[i] = ri->data->data[i];
-               break;
            case 't':
-               d->data[i] = ri->data->data[i];
                OP_REFCNT_LOCK;
-               ((reg_trie_data*)d->data[i])->refcount++;
+               ((reg_trie_data*)ri->data->data[i])->refcount++;
                OP_REFCNT_UNLOCK;
+               /* Fall through */
+           case 'n':
+               d->data[i] = ri->data->data[i];
                break;
            case 'T':
                d->data[i] = ri->data->data[i];