]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
sv_mortalcopy() is more efficient than sv_2mortal(newSVsv())
authorVincent Pit <vince@profvince.com>
Sun, 25 Jan 2009 19:56:30 +0000 (20:56 +0100)
committerVincent Pit <vince@profvince.com>
Sun, 25 Jan 2009 19:57:07 +0000 (20:57 +0100)
Magic.xs

index 08c61d23c9c37b61eb65228db5bc0cc196d8170c..5e461242b6dbf8b2b97071052aaee1f2031362c0 100644 (file)
--- 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: