summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
committerNicholas Clark <nick@ccl4.org>2007-02-18 19:40:43 +0000
commitb9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8 (patch)
tree65417bf74a7dc6b1ad198dcf0f64abbe38d16a66 /pp.c
parentbe2b1c742382f74864880924170180bbe1904463 (diff)
downloadperl-b9f83d2f7c4cb24d96302c6fcaa5e60628fad1f8.tar.gz
Add a new API function newSV_type, to replace the idiom:
sv = newSV(0); sv_upgrade(sv, type); p4raw-id: //depot/perl@30347
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index 04fab022d2..0cc80e67bb 100644
--- a/pp.c
+++ b/pp.c
@@ -323,8 +323,7 @@ PP(pp_av2arylen)
AV * const av = (AV*)TOPs;
SV ** const sv = Perl_av_arylen_p(aTHX_ (AV*)av);
if (!*sv) {
- *sv = newSV(0);
- sv_upgrade(*sv, SVt_PVMG);
+ *sv = newSV_type(SVt_PVMG);
sv_magic(*sv, (SV*)av, PERL_MAGIC_arylen, NULL, 0);
}
SETs(*sv);