diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-01-29 18:28:16 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-01-29 18:28:16 +0000 |
commit | 29a861e74521a5f903bccb023c86950d733fa0b7 (patch) | |
tree | 30399e656738dc7add2288fa2aebd589eeaaf041 /doio.c | |
parent | e30fbb82116d47ef2569f2af20359965dc7fcae1 (diff) | |
download | perl-29a861e74521a5f903bccb023c86950d733fa0b7.tar.gz |
Add av_create_and_push() and av_create_and_unshift_one() to refactor
out two repeated idioms.
p4raw-id: //depot/perl@30064
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -710,10 +710,9 @@ Perl_nextargv(pTHX_ register GV *gv) if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) { IoFLAGS(io) &= ~IOf_START; if (PL_inplace) { - if (!PL_argvout_stack) - PL_argvout_stack = newAV(); assert(PL_defoutgv); - av_push(PL_argvout_stack, SvREFCNT_inc_simple_NN(PL_defoutgv)); + Perl_av_create_and_push(aTHX_ &PL_argvout_stack, + SvREFCNT_inc_simple_NN(PL_defoutgv)); } } if (PL_filemode & (S_ISUID|S_ISGID)) { |