diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2021-11-23 23:35:58 +0000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2021-11-29 10:11:45 +1100 |
commit | 2a98b8cbbc6f75b5aaefb10acc4da4427359fcea (patch) | |
tree | 8a80adaddccc882df24d9656979b67aa8daeba95 /op.c | |
parent | c80a8618143e98aed6d9e5bbaee16d0308e211d0 (diff) | |
download | perl-2a98b8cbbc6f75b5aaefb10acc4da4427359fcea.tar.gz |
newSVpvn_flags().. is more efficient than sv_2mortal(newSVpvn(..))
The same holds for newSVpvs* wrappers around newSVpvn* functions.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -10934,9 +10934,9 @@ S_already_defined(pTHX_ CV *const cv, OP * const block, OP * const o, const line_t oldline = CopLINE(PL_curcop); SV *namesv = o ? cSVOPo->op_sv - : sv_2mortal(newSVpvn_utf8( - PadnamePV(name)+1,PadnameLEN(name)-1, PadnameUTF8(name) - )); + : newSVpvn_flags( PadnamePV(name)+1,PadnameLEN(name)-1, + (PadnameUTF8(name)) ? SVf_UTF8|SVs_TEMP : SVs_TEMP + ); if (PL_parser && PL_parser->copline != NOLINE) /* This ensures that warnings are reported at the first line of a redefinition, not the last. */ |