From bb38c7ee30b4bd390327870edf2d51f4ffe340ed Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sun, 15 Jan 2023 07:57:43 +0100 Subject: [PATCH] assert, comment --- Sim/Scan/QzScan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sim/Scan/QzScan.cpp b/Sim/Scan/QzScan.cpp index 1349842b804..cf9b2b17efc 100644 --- a/Sim/Scan/QzScan.cpp +++ b/Sim/Scan/QzScan.cpp @@ -15,6 +15,7 @@ #include "Sim/Scan/QzScan.h" #include "Base/Axis/FixedBinAxis.h" #include "Base/Axis/PointwiseAxis.h" +#include "Base/Util/Assert.h" #include "Device/Coord/CoordSystem1D.h" #include "Device/Pol/PolFilter.h" #include "Param/Distrib/ParameterSample.h" @@ -89,9 +90,8 @@ std::vector<SpecularElement> QzScan::generateElements() const std::vector<double> QzScan::footprint(size_t i, size_t n_elements) const { - if (i + n_elements > nSteps()) - throw std::runtime_error("Error in QzScan::footprint: given index exceeds the " - "number of simulation elements"); + ASSERT(i + n_elements <= nSteps()); + // There is no way to set a footprint correction for q scans. return std::vector<double>(n_elements, 1.0); } -- GitLab