correct use hash with keys

This commit is contained in:
Dietmar Maurer 2015-02-27 12:56:38 +01:00
parent 915a73d67b
commit 025e1d900b

View File

@ -687,7 +687,7 @@ __PACKAGE__->register_method({
delete $conf->{snapshots}; delete $conf->{snapshots};
if (!$param->{current}) { if (!$param->{current}) {
foreach my $opt (keys $conf->{pending}) { foreach my $opt (keys %{$conf->{pending}}) {
next if $opt eq 'delete'; next if $opt eq 'delete';
my $value = $conf->{pending}->{$opt}; my $value = $conf->{pending}->{$opt};
next if ref($value); # just to be sure next if ref($value); # just to be sure
@ -758,7 +758,7 @@ __PACKAGE__->register_method({
my $res = []; my $res = [];
foreach my $opt (keys $conf) { foreach my $opt (keys %$conf) {
next if ref($conf->{$opt}); next if ref($conf->{$opt});
my $item = { key => $opt }; my $item = { key => $opt };
$item->{value} = $conf->{$opt} if defined($conf->{$opt}); $item->{value} = $conf->{$opt} if defined($conf->{$opt});
@ -767,7 +767,7 @@ __PACKAGE__->register_method({
push @$res, $item; push @$res, $item;
} }
foreach my $opt (keys $conf->{pending}) { foreach my $opt (keys %{$conf->{pending}}) {
next if $opt eq 'delete'; next if $opt eq 'delete';
next if ref($conf->{pending}->{$opt}); # just to be sure next if ref($conf->{pending}->{$opt}); # just to be sure
next if defined($conf->{$opt}); next if defined($conf->{$opt});