mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps/graph][apps/sequence] In values controller, memoize the number of
columns to improve performance Change-Id: Ie3c545d0198a2f23575bd22fdbf56e9c6b8ff2b8
This commit is contained in:
@@ -12,9 +12,10 @@ Function * FunctionStore::activeFunctionAtIndex(int i) {
|
||||
assert(i>=0 && i<m_numberOfFunctions);
|
||||
int index = 0;
|
||||
for (int k = 0; k < m_numberOfFunctions; k++) {
|
||||
if (functionAtIndex(k)->isActive() && functionAtIndex(k)->isDefined()) {
|
||||
Function * function = functionAtIndex(k);
|
||||
if (function->isActive() && function->isDefined()) {
|
||||
if (i == index) {
|
||||
return functionAtIndex(k);
|
||||
return function;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
@@ -45,7 +46,8 @@ int FunctionStore::numberOfFunctions() {
|
||||
int FunctionStore::numberOfActiveFunctions() {
|
||||
int result = 0;
|
||||
for (int i = 0; i < m_numberOfFunctions; i++) {
|
||||
if (functionAtIndex(i)->isDefined() && functionAtIndex(i)->isActive()) {
|
||||
Function * function = functionAtIndex(i);
|
||||
if (function->isDefined() && function->isActive()) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user