summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-27 22:53:55 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-27 22:53:55 -0800
commitd0a10fd8bbd0cbe3a8289eb8a7b993a27d02b4d8 (patch)
treeb8402ae4f004f1c3496d72ddbc37148a854cabc5 /pp_sys.c
parentca2770d807cee660972b886c40b0aa841d784b64 (diff)
downloadperl-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.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index a301770671..c81e67fec2 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -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 */