diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2021-11-24 19:10:05 +0000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2021-11-29 10:07:19 +1100 |
commit | c80a8618143e98aed6d9e5bbaee16d0308e211d0 (patch) | |
tree | 8ec167ae5402f841d06ff850da52458dabc94e17 /perlio.c | |
parent | eb87cedb600ef8f1265ce27b13197ca7cbc33297 (diff) | |
download | perl-c80a8618143e98aed6d9e5bbaee16d0308e211d0.tar.gz |
newSVpvn_flags(x, .. ,SVs_TEMP) more efficient than sv_2mortal(newSVpv(x,0))
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4899,7 +4899,7 @@ PerlIO * PerlIO_open(const char *path, const char *mode) { dTHX; - SV *name = sv_2mortal(newSVpv(path, 0)); + SV *name = newSVpvn_flags(path, path == NULL ? 0 : strlen(path), SVs_TEMP); return PerlIO_openn(aTHX_ NULL, mode, -1, 0, 0, NULL, 1, &name); } @@ -4908,7 +4908,7 @@ PerlIO * PerlIO_reopen(const char *path, const char *mode, PerlIO *f) { dTHX; - SV *name = sv_2mortal(newSVpv(path,0)); + SV *name = newSVpvn_flags(path, path == NULL ? 0 : strlen(path), SVs_TEMP); return PerlIO_openn(aTHX_ NULL, mode, -1, 0, 0, f, 1, &name); } |