]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/CpuSet.pm
CpuSet short_string - avoid ranges like 0-0, 1-1, 2-2, ...
[pve-common.git] / src / PVE / CpuSet.pm
index 7293d9bcfe4cacfab58f0457907402c1c5433613..483405e194f2f35963a6480c7c049648d508ac85 100644 (file)
@@ -164,7 +164,11 @@ sub short_string {
            $next = $cpu;
        } else {
            $res .= ',' if length($res);
-           $res .= "$last-$next";
+           if ($last != $next) {
+               $res .= "$last-$next";
+           } else {
+               $res .= "$last";
+           }
            $last = $next = $cpu;
        }
     }