print_drive: Use $skip to avoid the need to copy the hash

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner 2020-02-24 13:43:53 +01:00 committed by Fabian Grünbichler
parent 375db731f7
commit d7117b5adb

View File

@ -1655,9 +1655,8 @@ sub parse_drive {
sub print_drive {
my ($drive) = @_;
my $data = { %$drive };
delete $data->{$_} for qw(index interface);
return PVE::JSONSchema::print_property_string($data, $alldrive_fmt);
my $skip = [ 'index', 'interface' ];
return PVE::JSONSchema::print_property_string($drive, $alldrive_fmt, $skip);
}
sub scsi_inquiry {