From: Dietmar Maurer Date: Wed, 21 Dec 2016 07:44:14 +0000 (+0100) Subject: CpuSet short_string - avoid ranges like 0-0, 1-1, 2-2, ... X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=74116083bb65f00217816db0b092b1f6d33d64e3;hp=1621113cec5df006eb9e1b9663a30477bcc02b58 CpuSet short_string - avoid ranges like 0-0, 1-1, 2-2, ... --- diff --git a/src/PVE/CpuSet.pm b/src/PVE/CpuSet.pm index 7293d9b..483405e 100644 --- a/src/PVE/CpuSet.pm +++ b/src/PVE/CpuSet.pm @@ -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; } }