In something like
for $pkg_var (...)
pp_enteriter() bumps the reference count or $pkg_var before making
itersave point to it. POPLOOP later decrements this ref count.
This bump is unnecessary; since we are effectively transferring ownership
(and thus ref count contribution) of the $pkg_var SV from the GvSV slot of
*pkg_var to the itersave slot of the context struct, the overall ref count
of the var should remain unchanged.
So skip the bump and later undo. This should make no functional difference;
it's just more efficient.
svp = &GvSV((GV*)svp); \
cursv = *svp; \
*svp = cx->blk_loop.itersave; \
- SvREFCNT_dec_NN(cx->blk_loop.itersave); \
} \
else { \
cursv = *svp; \
else if (LIKELY(isGV(TOPs))) { /* symbol table variable */
GV * const gv = MUTABLE_GV(POPs);
SV** svp = &GvSV(gv);
- itersave = SvREFCNT_inc(*svp);
+ itersave = *svp;
*svp = newSV(0);
itervar = (void *)gv;
}