summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-01-09 21:50:28 +0000
committerNicholas Clark <nick@ccl4.org>2005-01-09 21:50:28 +0000
commitff5bdd3795d35132380ba8c98bc3584895f25c76 (patch)
tree0a39120f54dc147d61f45477708dc7f2eee94689
parent2e0de35c58680e1e008b1d014c5b9ccec5b78282 (diff)
downloadperl-ff5bdd3795d35132380ba8c98bc3584895f25c76.tar.gz
If we know the length of the string constant, save a strlen()
p4raw-id: //depot/perl@23773
-rw-r--r--perl.c4
-rw-r--r--pp_sys.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index c59d8fb170..5bcdc7451a 100644
--- a/perl.c
+++ b/perl.c
@@ -3005,7 +3005,7 @@ S_init_main_stash(pTHX)
SvREFCNT_dec(GvHV(gv));
GvHV(gv) = (HV*)SvREFCNT_inc(PL_defstash);
SvREADONLY_on(gv);
- HvNAME(PL_defstash) = savepv("main");
+ HvNAME(PL_defstash) = savepvn("main", 4);
PL_incgv = gv_HVadd(gv_AVadd(gv_fetchpv("INC",TRUE, SVt_PVAV)));
GvMULTI_on(PL_incgv);
PL_hintgv = gv_fetchpv("\010",TRUE, SVt_PV); /* ^H */
@@ -3041,7 +3041,7 @@ S_open_script(pTHX_ char *scriptname, bool dosearch, SV *sv)
PL_suidscript = -1;
if (PL_e_script) {
- PL_origfilename = savepv("-e");
+ PL_origfilename = savepvn("-e", 2);
}
else {
/* if find_script() returns, it returns a malloc()-ed value */
diff --git a/pp_sys.c b/pp_sys.c
index 78cf48b945..419db0e22c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1342,7 +1342,7 @@ PP(pp_leavewrite)
!gv_fetchpv("top",FALSE,SVt_PVFM))
IoTOP_NAME(io) = savesvpv(topname);
else
- IoTOP_NAME(io) = savepv("top");
+ IoTOP_NAME(io) = savepvn("top", 3);
}
topgv = gv_fetchpv(IoTOP_NAME(io),FALSE, SVt_PVFM);
if (!topgv || !GvFORM(topgv)) {