From efd3ab012a05e77ab665f48009c2a0f10ade326c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 29 Dec 2011 10:41:40 +0100 Subject: [PATCH] Autovification sollte auch genau das tun, und nicht clobbern. --- SL/Request.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/Request.pm b/SL/Request.pm index d339cb7be..57b729798 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -153,8 +153,8 @@ sub _recode_recursively { # though. $to->{$key} = $iconv->convert("" . $from->{$key}); } else { - $to->{$key} = {} if 'HASH' eq ref $from->{$key}; - $to->{$key} = [] if 'ARRAY' eq ref $from->{$key}; + $to->{$key} ||= {} if 'HASH' eq ref $from->{$key}; + $to->{$key} ||= [] if 'ARRAY' eq ref $from->{$key}; _recode_recursively($iconv, $from->{$key}, $to->{$key}); } } @@ -167,8 +167,8 @@ sub _recode_recursively { # though. $from->[$idx] = $iconv->convert("" . $from->[$idx]); } else { - $to->[$idx] = {} if 'HASH' eq ref $from->[$idx]; - $to->[$idx] = [] if 'ARRAY' eq ref $from->[$idx]; + $to->[$idx] ||= {} if 'HASH' eq ref $from->[$idx]; + $to->[$idx] ||= [] if 'ARRAY' eq ref $from->[$idx]; _recode_recursively($iconv, $from->[$idx], $to->[$idx]); } } -- 2.20.1