diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-12-27 22:53:55 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-12-27 22:53:55 -0800 |
commit | d0a10fd8bbd0cbe3a8289eb8a7b993a27d02b4d8 (patch) | |
tree | b8402ae4f004f1c3496d72ddbc37148a854cabc5 | |
parent | ca2770d807cee660972b886c40b0aa841d784b64 (diff) | |
download | perl-d0a10fd8bbd0cbe3a8289eb8a7b993a27d02b4d8.tar.gz |
Use gmtime’s target
gmtime has a target allocated for it, but it hasn’t used that target
since 46fc3d4c6 (inseparable changes from match from perl-5.003_97g to
perl-5.003_97h, probably the ‘Mondo Cool patch’ mentioned in the com-
mit message).
There is no reason not to use it and avoid allocating a fresh SV with
each scalar-context call.
-rw-r--r-- | pp_sys.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4652,14 +4652,16 @@ PP(pp_gmtime) if (err == NULL) RETPUSHUNDEF; else { - mPUSHs(Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %"IVdf, + dTARGET; + PUSHs(TARG); + Perl_sv_setpvf_mg(aTHX_ TARG, "%s %s %2d %02d:%02d:%02d %"IVdf, dayname[tmbuf.tm_wday], monname[tmbuf.tm_mon], tmbuf.tm_mday, tmbuf.tm_hour, tmbuf.tm_min, tmbuf.tm_sec, - (IV)tmbuf.tm_year + 1900)); + (IV)tmbuf.tm_year + 1900); } } else { /* list context */ |