Commit fdf85908 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

use std::list::splice instead of erase + push_front. (trac #290).


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2514 e5f2f494-b856-4b98-b285-d166d9295462
parent 4ff6f8e0
...@@ -240,8 +240,7 @@ HotCacheImpl::promote(CacheNodePtr node) { ...@@ -240,8 +240,7 @@ HotCacheImpl::promote(CacheNodePtr node) {
if (node->lru_entry_ == lru_.begin()) { if (node->lru_entry_ == lru_.begin()) {
return; return;
} }
lru_.erase(node->lru_entry_); lru_.splice(lru_.begin(), lru_, node->lru_entry_); // move node to front
lru_.push_front(node);
node->lru_entry_ = lru_.begin(); node->lru_entry_ = lru_.begin();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment