File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
include/boost/compute/detail Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ class lru_cache
7575
7676 // insert the new item
7777 m_list.push_front (key);
78- m_map[ key] = std::make_pair (value, m_list.begin ());
78+ m_map. emplace ( key, std::make_pair (value, m_list.begin () ));
7979 }
8080 }
8181
@@ -97,18 +97,10 @@ class lru_cache
9797 m_list.push_front (key);
9898
9999 // update iterator in map
100- j = m_list.begin ();
101- const value_type &value = i->second .first ;
102- m_map[key] = std::make_pair (value, j);
103-
104- // return the value
105- return value;
106- }
107- else {
108- // the item is already at the front of the most recently
109- // used list so just return it
110- return i->second .first ;
100+ i->second .second = m_list.begin ();
111101 }
102+ // return the value
103+ return i->second .first ;
112104 }
113105
114106 void clear ()
You can’t perform that action at this time.
0 commit comments