]> git.proxmox.com Git - pve-storage.git/commitdiff
use one liner closure for outfunc
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Feb 2020 13:50:04 +0000 (14:50 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 19 Feb 2020 13:50:04 +0000 (14:50 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/PBSPlugin.pm

index 4521314e9fe0a5e02e26e7e0083974bd6b487634..2ac9ea0342d860bca3ef537fd0b5d143a8c6e5f9 100644 (file)
@@ -121,11 +121,7 @@ sub run_client_cmd {
     my ($scfg, $storeid, $client_cmd, $param, $no_output) = @_;
 
     my $json_str = '';
-
-    my $outfunc = sub {
-       my $line = shift;
-       $json_str .= "$line\n";
-    };
+    my $outfunc = sub { $json_str .= "$_[0]\n" };
 
     $param = [] if !defined($param);
     $param = [ $param ] if !ref($param);
@@ -150,11 +146,7 @@ sub extract_vzdump_config {
     my ($vtype, $name, $vmid, undef, undef, undef, $format) = $class->parse_volname($volname);
 
     my $config = '';
-
-    my $outfunc = sub {
-       my $line = shift;
-       $config .= "$line\n";
-    };
+    my $outfunc = sub { $config .= "$_[0]\n" };
 
     my $config_name;
     if ($format eq 'pbs-vm') {