From be6b9d804ca31f8e1f1cd449fe816b88392d0c56 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Tue, 12 Nov 2019 14:58:44 +0100 Subject: [PATCH] [apps/graph/values_controller] Fix assertion in plotTypeAtColumn --- apps/graph/values/values_controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/graph/values/values_controller.cpp b/apps/graph/values/values_controller.cpp index 98eb2862a..d5783efce 100644 --- a/apps/graph/values/values_controller.cpp +++ b/apps/graph/values/values_controller.cpp @@ -237,10 +237,10 @@ int ValuesController::numberOfValuesColumns() { ContinuousFunction::PlotType ValuesController::plotTypeAtColumn(int * i) const { int plotTypeIndex = 0; - while (plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes && *i >= numberOfColumnsForPlotType(plotTypeIndex)) { + while (*i >= numberOfColumnsForPlotType(plotTypeIndex)) { *i -= numberOfColumnsForPlotType(plotTypeIndex++); + assert(plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes); } - assert(plotTypeIndex < ContinuousFunction::k_numberOfPlotTypes); return static_cast(plotTypeIndex); }