From 74116083bb65f00217816db0b092b1f6d33d64e3 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 21 Dec 2016 08:44:14 +0100 Subject: [PATCH 1/1] CpuSet short_string - avoid ranges like 0-0, 1-1, 2-2, ... --- src/PVE/CpuSet.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } } -- 2.39.2