]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Tools.pm
array_intersect: allow passing list of references for convenience
[pve-common.git] / src / PVE / Tools.pm
index a9addcd7e595cc0737a0f1d3eca9f84da9e18447..676647eefb375d8d1ad00e9d06ab404baab9c906 100644 (file)
@@ -1654,6 +1654,10 @@ sub dev_t_minor($) {
 sub array_intersect {
     my ($arrays) = @_;
 
+    if (!ref($arrays->[0])) {
+       $arrays = [ grep { ref($_) eq 'ARRAY' } @_ ];
+    }
+
     return [] if scalar(@$arrays) == 0;
     return $arrays->[0] if scalar(@$arrays) == 1;