[shared] StorageCartesianFunctionStore: fix moveMemoizedModel (confusion

between arguments)
This commit is contained in:
Émilie Feral
2018-10-12 17:27:11 +02:00
parent 3399ad5411
commit 7ee5cdde82
3 changed files with 5 additions and 5 deletions

View File

@@ -20,10 +20,10 @@ void StorageCartesianFunctionStore::setMemoizedModelAtIndex(int cacheIndex, Ion:
m_functions[cacheIndex] = StorageCartesianFunction(record);
}
void StorageCartesianFunctionStore::moveMemoizedModel(int previousIndex, int nextIndex) const {
assert(nextIndex >= 0 && nextIndex < k_maxNumberOfMemoizedModels);
void StorageCartesianFunctionStore::moveMemoizedModel(int newIndex, int previousIndex) const {
assert(newIndex >= 0 && newIndex < k_maxNumberOfMemoizedModels);
assert(previousIndex >= 0 && previousIndex < k_maxNumberOfMemoizedModels);
m_functions[nextIndex] = m_functions[previousIndex];
m_functions[newIndex] = m_functions[previousIndex];
}
StorageExpressionModel * StorageCartesianFunctionStore::memoizedModelAtIndex(int cacheIndex) const {

View File

@@ -18,7 +18,7 @@ private:
Ion::Storage::Record::ErrorStatus addEmptyModel() override;
const char * modelExtension() const override { return Shared::GlobalContext::funcExtension; }
void setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const override;
void moveMemoizedModel(int previousIndex, int nextIndex) const override;
void moveMemoizedModel(int newIndex, int previousIndex) const override;
Shared::StorageExpressionModel * memoizedModelAtIndex(int cacheIndex) const override;
mutable Shared::StorageCartesianFunction m_functions[k_maxNumberOfMemoizedModels];
};

View File

@@ -37,7 +37,7 @@ private:
mutable int m_firstMemoizedModelIndex;
mutable uint32_t m_storageChecksum;
virtual void setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record) const = 0;
virtual void moveMemoizedModel(int previousIndex, int nextIndex) const = 0;
virtual void moveMemoizedModel(int newIndex, int previousIndex) const = 0;
virtual StorageExpressionModel * memoizedModelAtIndex(int cacheIndex) const = 0;
};