From 794517f52fe9200cd509086309313dbb9e7874af Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 12 Sep 2013 14:32:17 -0700 Subject: lru_map: don't use list::size() replace list::size() with map::size(), which should have a constant time complexity. Signed-off-by: Yehuda Sadeh --- src/common/lru_map.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/lru_map.h b/src/common/lru_map.h index aa0b339b834..6e7f7b3786f 100644 --- a/src/common/lru_map.h +++ b/src/common/lru_map.h @@ -67,7 +67,7 @@ void lru_map::add(const K& key, V& value) e.value = value; e.lru_iter = entries_lru.begin(); - while (entries_lru.size() > max) { + while (entries.size() > max) { typename std::list::reverse_iterator riter = entries_lru.rbegin(); iter = entries.find(*riter); // assert(iter != entries.end()); -- cgit v1.2.1