> > + if ($class eq 'ARRAY') { > > + my $res = []; > > + foreach my $el (@$tree) { > > + push @$res, api_dump_remove_refs($el); > > + } > > + return $res; > > above 4 lines could be written as: > > return [ map { api_dump_remove_refs($_) } @$tree ];
I still prefer the other style. > > > + } elsif ($class eq 'HASH') { > > + my $res = {}; > > + foreach my $k (keys %$tree) { > > + if (my $class = ref($tree->{$k})) { > > You're redeclaring $class here, not a problem per se but may be confused > with the above declaration or could lead to subtle bugs if this gets > refactored or copied and adapted for somewhere else. OK, will change that. _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel