[pve-devel] [PATCH storage 2/3] disks: die if storage name is already in use

Fabian Ebner f.ebner at proxmox.com
Thu Jul 14 14:12:08 CEST 2022


Am 14.07.22 um 13:13 schrieb Dominik Csapak:> On 7/13/22 12:47, Aaron
Lauterer wrote:
>> +    my $poollist = { map { $_->{name} => 1 } @{$pools} };
> 
> does that really make sense here? would it not be easier to just
> iterate? e.g.
> 
> ----
> for my $pool (@$pools) {
>     die "..." if $pool->{name} eq $name;
> }
> ----
> 
> (i admit, it's 1 line longer, but a bit more readable?)
> 
>> +    die "pool '${name}' already exists on node '$node'\n" if

Or just use grep ;)




More information about the pve-devel mailing list