while this was much better than the old mess from
parse_pending_delete it still was a bit much nested into one line.
split that up a bit, add a render_key helper which does the clunky
"add !" check and just call that one in the map {}
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
sub print_pending_delete {
my ($class, $delete_hash) = @_;
- join ",", map { ( $delete_hash->{$_}->{force} ? '!' : '' ) . $_ } keys %$delete_hash;
+
+ my $render_key = sub {
+ my $key = shift;
+ $key = "!$key" if $delete_hash->{$key}->{force};
+ return $key;
+ };
+
+ join (',', map { $render_key->($_) } keys %$delete_hash);
}
sub add_to_pending_delete {