From 7ee5cdde8260676a1da70e408fd752ab4b902cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Fri, 12 Oct 2018 17:27:11 +0200 Subject: [PATCH] [shared] StorageCartesianFunctionStore: fix moveMemoizedModel (confusion between arguments) --- apps/graph/storage_cartesian_function_store.cpp | 6 +++--- apps/graph/storage_cartesian_function_store.h | 2 +- apps/shared/storage_expression_model_store.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/graph/storage_cartesian_function_store.cpp b/apps/graph/storage_cartesian_function_store.cpp index 348cf02ca..4f7eee790 100644 --- a/apps/graph/storage_cartesian_function_store.cpp +++ b/apps/graph/storage_cartesian_function_store.cpp @@ -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 { diff --git a/apps/graph/storage_cartesian_function_store.h b/apps/graph/storage_cartesian_function_store.h index 5885150e3..70af7b8af 100644 --- a/apps/graph/storage_cartesian_function_store.h +++ b/apps/graph/storage_cartesian_function_store.h @@ -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]; }; diff --git a/apps/shared/storage_expression_model_store.h b/apps/shared/storage_expression_model_store.h index 854f92011..f88827631 100644 --- a/apps/shared/storage_expression_model_store.h +++ b/apps/shared/storage_expression_model_store.h @@ -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; };