From: Dietmar Maurer Date: Thu, 17 Sep 2015 15:45:59 +0000 (+0200) Subject: updateSchema: code cleanup - avoid assigning same value multiple times X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=516dfb55e1d1e542cafe72c09798f658db950fd2 updateSchema: code cleanup - avoid assigning same value multiple times --- diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm index 5fc479e..d4d2ed5 100644 --- a/src/PVE/SectionConfig.pm +++ b/src/PVE/SectionConfig.pm @@ -75,13 +75,17 @@ sub updateSchema { $props->{$p} = $propertyList->{$p}; next; } + + my $modifyable = 0; + foreach my $t (keys %$plugins) { - my $opts = $pdata->{options}->{$t}; + my $opts = $pdata->{options}->{$t} || {}; next if !defined($opts->{$p}); - if (!$opts->{$p}->{fixed}) { - $props->{$p} = $propertyList->{$p}; - } + $modifyable = 1 if !$opts->{$p}->{fixed}; } + next if !$modifyable; + + $props->{$p} = $propertyList->{$p}; } $props->{digest} = get_standard_option('pve-config-digest');