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 7293d9b..483405e 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;
        }
     }