Skip to content
Snippets Groups Projects
Commit afe1b449 authored by Oliver Sander's avatar Oliver Sander
Browse files

Properly implement check in method 'touch'

A previous commit introduced a check whether the element to-be-touched
is actually contained in the container.  That patch caused the test
to fail.  The new patch fixes this.
parent 98ecb986
No related branches found
No related tags found
No related merge requests found
......@@ -182,15 +182,15 @@ namespace Dune {
reference touch (const key_type & key)
{
/* query _index for iterator */
iterator it = _index[key];
map_iterator it = _index.find(key);
if (it == _index.end())
DUNE_THROW(Dune::RangeError,
"Failed to touch key " << key << ", it is not in the lru container");
/* update _data
move it to the front
*/
_data.splice(_data.begin(), _data, it);
return it->second;
_data.splice(_data.begin(), _data, it->second);
return it->second->second;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment