From b89b62a6b9f1d60bb54e09316f97961b7a670ce1 Mon Sep 17 00:00:00 2001 From: Alex Buts <Alex.Buts@stfc.ac.uk> Date: Tue, 13 Oct 2015 17:01:09 +0100 Subject: [PATCH] Re #13566 GCC pedantic warnings --- Framework/Kernel/src/VectorHelper.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Framework/Kernel/src/VectorHelper.cpp b/Framework/Kernel/src/VectorHelper.cpp index 02ed7bcd6f0..7c56ee11a74 100644 --- a/Framework/Kernel/src/VectorHelper.cpp +++ b/Framework/Kernel/src/VectorHelper.cpp @@ -582,6 +582,11 @@ double runAverage(size_t index, size_t startIndex, size_t endIndex, weight1 = (end - binBndrs->operator[](iEnd)) / (binBndrs->operator[](iEnd + 1) - binBndrs->operator[](iEnd)); } + if (iStart > iEnd) { // start and end get into the same bin + weight1 = 0; + weight0 = (end - start) / + (binBndrs->operator[](iStart)-binBndrs->operator[](iStart - 1)); + } } else { // integer indexes and functions defined in the bin centers iStart = index - static_cast<size_t>(halfWidth); if (startIndex + static_cast<size_t>(halfWidth) > index) @@ -590,11 +595,6 @@ double runAverage(size_t index, size_t startIndex, size_t endIndex, if (iEnd > endIndex) iEnd = endIndex; } - if (iStart > iEnd) { // start and end get into the same bin - weight1 = 0; - weight0 = (end - start) / - (binBndrs->operator[](iStart)-binBndrs->operator[](iStart - 1)); - } double avrg = 0; size_t ic = 0; @@ -612,7 +612,7 @@ double runAverage(size_t index, size_t startIndex, size_t endIndex, } else { return avrg / double(ic); } -}; +} } /** Basic running average of input vector within specified range, considering * variable bin-boundaries if such boundaries are provided. -- GitLab