]> git.proxmox.com Git - pve-common.git/commitdiff
CpuSet short_string - avoid ranges like 0-0, 1-1, 2-2, ...
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Dec 2016 07:44:14 +0000 (08:44 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Dec 2016 07:44:14 +0000 (08:44 +0100)
src/PVE/CpuSet.pm

index 7293d9bcfe4cacfab58f0457907402c1c5433613..483405e194f2f35963a6480c7c049648d508ac85 100644 (file)
@@ -164,7 +164,11 @@ sub short_string {
            $next = $cpu;
        } else {
            $res .= ',' if length($res);
            $next = $cpu;
        } else {
            $res .= ',' if length($res);
-           $res .= "$last-$next";
+           if ($last != $next) {
+               $res .= "$last-$next";
+           } else {
+               $res .= "$last";
+           }
            $last = $next = $cpu;
        }
     }
            $last = $next = $cpu;
        }
     }