From: Vincent Pit Date: Sun, 25 Jan 2009 19:56:30 +0000 (+0100) Subject: sv_mortalcopy() is more efficient than sv_2mortal(newSVsv()) X-Git-Tag: v0.29~7 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=df960e82cd3afbcdb73a674281a116ddce54a2f8;p=perl%2Fmodules%2FVariable-Magic.git sv_mortalcopy() is more efficient than sv_2mortal(newSVsv()) --- diff --git a/Magic.xs b/Magic.xs index 08c61d2..5e46124 100644 --- a/Magic.xs +++ b/Magic.xs @@ -694,7 +694,7 @@ STATIC I32 vmg_svt_val(pTHX_ IV action, SV *sv) { continue; case 2: if (!newkey) - newkey = key = umg->mg_obj = sv_2mortal(newSVsv(umg->mg_obj)); + newkey = key = umg->mg_obj = sv_mortalcopy(umg->mg_obj); } switch (action) { case 0: