Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions include/boost/compute/detail/lru_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,9 @@ class lru_cache
typename list_type::iterator j = i->second.second;
if(j != m_list.begin()){
// move item to the front of the most recently used list
m_list.erase(j);
m_list.push_front(key);

// update iterator in map
j = m_list.begin();
const value_type &value = i->second.first;
m_map[key] = std::make_pair(value, j);

m_list.splice(m_list.begin(), m_list, j, std::next(j));
// return the value
return value;
return i->second.first;
}
else {
// the item is already at the front of the most recently
Expand Down