From a7282e6f33d3e02429be0fea3d679f96dd1cd935 Mon Sep 17 00:00:00 2001 From: Ruben Dashyan Date: Fri, 20 Sep 2019 16:38:31 +0200 Subject: [PATCH] [apps/graph/graph_view] Do not recompute numberOfActiveFunctions --- apps/graph/graph/graph_view.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/graph/graph/graph_view.cpp b/apps/graph/graph/graph_view.cpp index b607bf6e5..b0d3a41bd 100644 --- a/apps/graph/graph/graph_view.cpp +++ b/apps/graph/graph/graph_view.cpp @@ -24,7 +24,8 @@ void GraphView::reload() { void GraphView::drawRect(KDContext * ctx, KDRect rect) const { FunctionGraphView::drawRect(ctx, rect); ContinuousFunctionStore * functionStore = App::app()->functionStore(); - for (int i = 0; i < functionStore->numberOfActiveFunctions(); i++) { + const int activeFunctionsCount = functionStore->numberOfActiveFunctions(); + for (int i = 0; i < activeFunctionsCount ; i++) { Ion::Storage::Record record = functionStore->activeRecordAtIndex(i); ExpiringPointer f = functionStore->modelForRecord(record);; Shared::ContinuousFunction::PlotType type = f->plotType();