Made RemoveBySubset from the cache work with references to keys

pull/137/head
Cedric Nugteren 2017-02-12 11:58:20 +01:00
parent 36b942a698
commit faa842b927
2 changed files with 3 additions and 3 deletions

View File

@ -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
// =================================================================================================

View File

@ -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();