]> git.proxmox.com Git - pve-cluster.git/commitdiff
addnode: code reduction
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 7 Nov 2021 19:43:58 +0000 (20:43 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 7 Nov 2021 19:44:00 +0000 (20:44 +0100)
no semantic change intended

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/API2/ClusterConfig.pm

index c3f2725a5954d638e728253396d5260d511fc416..df3332d21c9588d2815e6a637562377de30f1b16 100644 (file)
@@ -410,20 +410,13 @@ __PACKAGE__->register_method ({
        $config_change_lock->($code);
 
        # If vc_errors is set, we died because of verify_conf.
-       # Raise this error, since it contains more information than just a
-       # single-line string.
+       # Raise this error, since it contains more information than just a single-line string.
        if (defined($vc_errors) && scalar(@$vc_errors)) {
            my $err_hash = {};
            my $add_errs = sub {
-               my $type = shift;
-               my @arr = @_;
+               my ($type, @arr) = @_;
                return if !scalar(@arr);
-
-               my %newhash = map { $type . $_ => $arr[$_] } 0..$#arr;
-               $err_hash = {
-                   %$err_hash,
-                   %newhash,
-               };
+               $err_hash->{"${type}$_"} = $arr[$_] for 0..$#arr;
            };
 
            $add_errs->("warning", @$vc_warnings);