Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 15, 2019
1 parent 303e83f commit 8aacb31
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/plugins/datastoreinterface.h
Expand Up @@ -52,7 +52,7 @@ class DataStoreArray
private:
int mReferenceCounter = 1;

const quint64 mSize;
quint64 mSize;
double *mData = nullptr;
};

Expand Down
20 changes: 12 additions & 8 deletions src/plugins/support/SimulationSupport/src/simulation.cpp
Expand Up @@ -623,18 +623,22 @@ bool SimulationData::doIsModified(bool pCheckConstants) const
// Note: we start with our states since they are more likely to be modified
// than our constants...

for (quint64 i = 0, iMax = mStatesArray->size(); i < iMax; ++i) {
if (!qFuzzyCompare(mStatesArray->data(i), mInitialStates[i])) {
return true;
}
}
CellMLSupport::CellmlFileRuntime *runtime = mSimulation->runtime();

if (pCheckConstants) {
for (quint64 i = 0, iMax = mConstantsArray->size(); i < iMax; ++i) {
if (!qFuzzyCompare(mConstantsArray->data(i), mInitialConstants[i])) {
if (runtime != nullptr) {
for (quint64 i = 0, iMax = mStatesArray->size(); i < iMax; ++i) {
if (!qFuzzyCompare(mStatesArray->data(i), mInitialStates[i])) {
return true;
}
}

if (pCheckConstants) {
for (quint64 i = 0, iMax = mConstantsArray->size(); i < iMax; ++i) {
if (!qFuzzyCompare(mConstantsArray->data(i), mInitialConstants[i])) {
return true;
}
}
}
}

return false;
Expand Down

0 comments on commit 8aacb31

Please sign in to comment.