diff options
author | David Mitchell <davem@iabyn.com> | 2013-04-16 12:12:21 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2013-04-20 17:23:12 +0100 |
commit | 3bede41cd4f88a0bf4c69390f4fbce674c9b4cb3 (patch) | |
tree | dffb7407e143502e6b0fd2f6758076420b7ea0bc /regcomp.c | |
parent | 467cc54e2ada8b8c74001c2e8e45d0a14b09338b (diff) | |
download | perl-3bede41cd4f88a0bf4c69390f4fbce674c9b4cb3.tar.gz |
re_op_compile: eliminate a local var and scope
Eliminate a local var and the block scope it is declared in
(There should be no functional changes).
Re-indenting will be in the next commit.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 28 |
1 files changed, 11 insertions, 17 deletions
@@ -5563,25 +5563,20 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, } - { - /* concat args, handling magic, overloading etc */ - - OP *o = NULL; - DEBUG_PARSE_r(PerlIO_printf(Perl_debug_log, "Assembling pattern from %d elements%s\n", pat_count, orig_rx_flags & RXf_SPLIT ? " for split" : "")); - if (pRExC_state->num_code_blocks) { - if (expr->op_type == OP_CONST) - o = expr; - else { - o = cLISTOPx(expr)->op_first; - assert( o->op_type == OP_PUSHMARK - || (o->op_type == OP_NULL && o->op_targ == OP_PUSHMARK) - || o->op_type == OP_PADRANGE); - o = o->op_sibling; - } + /* set expr to the first arg op */ + + if (pRExC_state->num_code_blocks + && expr->op_type != OP_CONST) + { + expr = cLISTOPx(expr)->op_first; + assert( expr->op_type == OP_PUSHMARK + || (expr->op_type == OP_NULL && expr->op_targ == OP_PUSHMARK) + || expr->op_type == OP_PADRANGE); + expr = expr->op_sibling; } if (pat_count > 1) { @@ -5590,7 +5585,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, } pat = S_concat_pat(aTHX_ pRExC_state, pat, new_patternp, pat_count, - o, &recompile); + expr, &recompile); if (pat_count > 1) SvSETMAGIC(pat); @@ -5612,7 +5607,6 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count, return (REGEXP*)re; } } - } exp = SvPV_nomg(pat, plen); |