summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-15 22:12:41 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:23 +0100
commit3773545d7938a87216a5f326c367a8c445193939 (patch)
tree5114f3113d95617bb9bb7508db97b42f40e6a710 /mg.c
parent7c114860c0fa8ade5e00a4b609d2fbd11d5a494c (diff)
downloadperl-3773545d7938a87216a5f326c367a8c445193939.tar.gz
change sv_setsv(sv,NULL) to sv_set_undef(sv)
There are still a few core occurrences of sv_setsv(sv, NULL); which is equivalent to sv_setsv(sv, &PL_sv_undef); but which can now be done more efficiently with sv_set_undef(sv);
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mg.c b/mg.c
index 498a141599..3b341d52d1 100644
--- a/mg.c
+++ b/mg.c
@@ -710,7 +710,7 @@ Perl_magic_regdatum_get(pTHX_ SV *sv, MAGIC *mg)
}
}
}
- sv_setsv(sv, NULL);
+ sv_set_undef(sv);
return 0;
}
@@ -849,7 +849,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
case '\005': /* ^E */
if (nextchar != '\0') {
if (strEQ(remaining, "NCODING"))
- sv_setsv(sv, NULL);
+ sv_set_undef(sv);
break;
}
@@ -960,7 +960,8 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
SvROK_on(sv);
sv_rvweaken(sv);
}
- else sv_setsv_nomg(sv, NULL);
+ else
+ sv_set_undef(sv);
}
break;
case '\017': /* ^O & ^OPEN */
@@ -2061,7 +2062,7 @@ Perl_magic_getarylen(pTHX_ SV *sv, const MAGIC *mg)
if (obj) {
sv_setiv(sv, AvFILL(obj));
} else {
- sv_setsv(sv, NULL);
+ sv_set_undef(sv);
}
return 0;
}
@@ -2139,7 +2140,7 @@ Perl_magic_getpos(pTHX_ SV *sv, MAGIC *mg)
sv_setuv(sv, i);
return 0;
}
- sv_setsv(sv,NULL);
+ sv_set_undef(sv);
return 0;
}