summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-04-25 09:23:25 +0100
committerNicholas Clark <nick@ccl4.org>2010-04-25 09:23:25 +0100
commitdb4b3a1d2c56c299e29a8bc6aa4d010bf566e9fc (patch)
tree02f44ce3505082352a2d5ae9c98903f46abce98b /mg.c
parentefaf36747029c85b4d8825318cb4d485a0bb350e (diff)
downloadperl-db4b3a1d2c56c299e29a8bc6aa4d010bf566e9fc.tar.gz
In S_magic_methcall1(), tweak the initialisation of arg1 to reduce code size.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mg.c b/mg.c
index 24d2b986a5..b6bd2979c4 100644
--- a/mg.c
+++ b/mg.c
@@ -1718,15 +1718,13 @@ S_magic_methcall1(pTHX_ SV *sv, const MAGIC *mg, const char *meth, I32 flags,
if (mg->mg_ptr) {
if (mg->mg_len >= 0) {
- arg1 = newSVpvn(mg->mg_ptr, mg->mg_len);
- sv_2mortal(arg1);
+ arg1 = newSVpvn_flags(mg->mg_ptr, mg->mg_len, SVs_TEMP);
}
else if (mg->mg_len == HEf_SVKEY)
arg1 = MUTABLE_SV(mg->mg_ptr);
}
else if (mg->mg_type == PERL_MAGIC_tiedelem) {
- arg1 = newSV_type(SVt_IV);
- sv_setiv(arg1, (IV)(mg->mg_len));
+ arg1 = newSViv((IV)(mg->mg_len));
sv_2mortal(arg1);
}
if (!arg1) {