From 9f9c08133a34e4c203d26d466808f74b2c680da2 Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 3 Sep 2020 08:01:41 -0700 Subject: [PATCH 1/2] to make static analyzer happy in RunningAverage --- FWCore/Utilities/interface/RunningAverage.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FWCore/Utilities/interface/RunningAverage.h b/FWCore/Utilities/interface/RunningAverage.h index c60d51fbbb83d..2c792ac5bfbab 100644 --- a/FWCore/Utilities/interface/RunningAverage.h +++ b/FWCore/Utilities/interface/RunningAverage.h @@ -29,7 +29,8 @@ namespace edm { int upper() const { auto lm = mean(); - return lm += (std::abs(m_buffer[0] - lm) + std::abs(m_buffer[N / 2] - lm)); + lm += (std::abs(m_buffer[0] - lm) + std::abs(m_buffer[N / 2] - lm)); + return lm; } // about 2 sigma void update(unsigned int q) { From a11e5bf7aeac2838632300bc47a9d9321db04f0b Mon Sep 17 00:00:00 2001 From: Slava Krutelyov Date: Thu, 3 Sep 2020 12:03:39 -0700 Subject: [PATCH 2/2] back to the same number of loc --- FWCore/Utilities/interface/RunningAverage.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/FWCore/Utilities/interface/RunningAverage.h b/FWCore/Utilities/interface/RunningAverage.h index 2c792ac5bfbab..8a5564cac7cfe 100644 --- a/FWCore/Utilities/interface/RunningAverage.h +++ b/FWCore/Utilities/interface/RunningAverage.h @@ -29,8 +29,7 @@ namespace edm { int upper() const { auto lm = mean(); - lm += (std::abs(m_buffer[0] - lm) + std::abs(m_buffer[N / 2] - lm)); - return lm; + return lm + (std::abs(m_buffer[0] - lm) + std::abs(m_buffer[N / 2] - lm)); } // about 2 sigma void update(unsigned int q) {