Skip to content

Commit fe31205

Browse files
committed
Simplify a few callsites with the newPADxVOP() function
1 parent dd6f569 commit fe31205

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

op.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3839,8 +3839,7 @@ S_apply_attrs_my(pTHX_ HV *stash, OP *target, OP *attrs, OP **imopsp)
38393839
/* Build up the real arg-list. */
38403840
stashsv = newSVhek(HvNAME_HEK(stash));
38413841

3842-
arg = newOP(OP_PADSV, 0);
3843-
arg->op_targ = target->op_targ;
3842+
arg = newPADxVOP(OP_PADSV, 0, target->op_targ);
38443843
arg = op_prepend_elem(OP_LIST,
38453844
newSVOP(OP_CONST, 0, stashsv),
38463845
op_prepend_elem(OP_LIST,
@@ -13270,10 +13269,9 @@ Perl_ck_sort(pTHX_ OP *o)
1327013269
kSVOP->op_sv = fq;
1327113270
}
1327213271
else {
13273-
OP * const padop = newOP(OP_PADCV, 0);
13274-
padop->op_targ = off;
1327513272
/* replace the const op with the pad op */
13276-
op_sibling_splice(firstkid, NULL, 1, padop);
13273+
op_sibling_splice(firstkid, NULL, 1,
13274+
newPADxVOP(OP_PADCV, 0, off));
1327713275
op_free(kid);
1327813276
}
1327913277
}

toke.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11236,8 +11236,7 @@ S_scan_inputsymbol(pTHX_ char *start)
1123611236
goto intro_sym;
1123711237
}
1123811238
else {
11239-
OP * const o = newOP(OP_PADSV, 0);
11240-
o->op_targ = tmp;
11239+
OP * const o = newPADxVOP(OP_PADSV, 0, tmp);
1124111240
PL_lex_op = readline_overriden
1124211241
? newUNOP(OP_ENTERSUB, OPf_STACKED,
1124311242
op_append_elem(OP_LIST, o,

0 commit comments

Comments
 (0)