summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-02-12 11:58:20 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-02-12 11:58:20 +0100
commitfaa842b927ede6df1763607e3732151162875d73 (patch)
tree8400dc927ab7dc752e67b6bc605a83537786d3cd
parent36b942a6982578af33ca26a5306ebd7012f2329b (diff)
Made RemoveBySubset from the cache work with references to keys
-rw-r--r--src/cache.cpp4
-rw-r--r--src/cache.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cache.cpp b/src/cache.cpp
index c7b4792e..4b74b0a1 100644
--- a/src/cache.cpp
+++ b/src/cache.cpp
@@ -82,7 +82,7 @@ void Cache<Key, Value>::Remove(const Key &key) {
template <typename Key, typename Value>
template <int I1, int I2>
-void Cache<Key, Value>::RemoveBySubset(const Key key) {
+void Cache<Key, Value>::RemoveBySubset(const Key &key) {
std::lock_guard<std::mutex> lock(cache_mutex_);
auto it = cache_.begin();
while (it != cache_.end()) {
@@ -119,7 +119,7 @@ template std::string BinaryCache::Get(const BinaryKeyRef &, bool *) const;
template class Cache<ProgramKey, Program>;
template Program ProgramCache::Get(const ProgramKeyRef &, bool *) const;
-template void ProgramCache::RemoveBySubset<1, 2>(const ProgramKey); // by precision and routine name
+template void ProgramCache::RemoveBySubset<1, 2>(const ProgramKey &); // precision and routine name
// =================================================================================================
diff --git a/src/cache.hpp b/src/cache.hpp
index f3685b03..f7ca3dc8 100644
--- a/src/cache.hpp
+++ b/src/cache.hpp
@@ -44,7 +44,7 @@ public:
// Removes all entries with a given key
void Remove(const Key &key);
- template <int I1, int I2> void RemoveBySubset(const Key key); // currently only supports 2 indices
+ template <int I1, int I2> void RemoveBySubset(const Key &key); // currently supports 2 indices
static Cache<Key, Value> &Instance();