From bd4788825a02626aa42b76feb7e9c805876b2914 Mon Sep 17 00:00:00 2001 From: Aleksandr Chibisov Date: Tue, 27 Jun 2023 15:11:36 +0300 Subject: [PATCH] fix wrong PerfData normalization --- lib/base/perfdatavalue.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/base/perfdatavalue.cpp b/lib/base/perfdatavalue.cpp index 60a39e4e841..2d59dc12110 100644 --- a/lib/base/perfdatavalue.cpp +++ b/lib/base/perfdatavalue.cpp @@ -363,20 +363,21 @@ String PerfdataValue::Format() const result << unit; + result << ";"; if (!GetWarn().IsEmpty()) { - result << ";" << Convert::ToString(GetWarn()); - - if (!GetCrit().IsEmpty()) { - result << ";" << Convert::ToString(GetCrit()); - - if (!GetMin().IsEmpty()) { - result << ";" << Convert::ToString(GetMin()); - - if (!GetMax().IsEmpty()) { - result << ";" << Convert::ToString(GetMax()); - } - } - } + result << Convert::ToString(GetWarn()); + } + result << ";"; + if (!GetCrit().IsEmpty()) { + result << Convert::ToString(GetCrit()); + } + result << ";"; + if (!GetMin().IsEmpty()) { + result << Convert::ToString(GetMin()); + } + result << ";"; + if (!GetMax().IsEmpty()) { + result << Convert::ToString(GetMax()); } return result.str();