[pve-devel] [PATCH network] api: controller: iterate over keys instead of whole map
    Gabriel Goller 
    g.goller at proxmox.com
       
    Tue May 20 17:01:01 CEST 2025
    
    
  
Previously, we iterated over the entire hash (keys and values), which
added unnecessary data to the configuration. This commit changes the
loop to iterate only over the hash keys.
Nothing should change as the garbled properties were removed down the
line anyway.
Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
---
 src/PVE/API2/Network/SDN/Controllers.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/PVE/API2/Network/SDN/Controllers.pm b/src/PVE/API2/Network/SDN/Controllers.pm
index 38a685d48d06..b776273a6278 100644
--- a/src/PVE/API2/Network/SDN/Controllers.pm
+++ b/src/PVE/API2/Network/SDN/Controllers.pm
@@ -235,7 +235,7 @@ __PACKAGE__->register_method ({
 		PVE::SectionConfig::delete_from_config($scfg, $options, $opts, $delete);
 	    }
 
-	    foreach my $k (%$opts) {
+	    for my $k (keys %{$opts}) {
 		$scfg->{$k} = $opts->{$k};
 	    }
 
-- 
2.39.5
    
    
More information about the pve-devel
mailing list