summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@inktank.com>2013-09-12 14:32:17 -0700
committerYehuda Sadeh <yehuda@inktank.com>2013-09-12 14:32:17 -0700
commit794517f52fe9200cd509086309313dbb9e7874af (patch)
tree9bea4c23b3d4d5f5953a0cc9d8840077f6e933dc
parent879f1a9e83a2f93ffbab9b615280c776b9c5decf (diff)
downloadceph-wip-6294.tar.gz
lru_map: don't use list::size()wip-6294
replace list::size() with map::size(), which should have a constant time complexity. Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r--src/common/lru_map.h2
1 files changed, 1 insertions, 1 deletions
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<K, V>::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<K>::reverse_iterator riter = entries_lru.rbegin();
iter = entries.find(*riter);
// assert(iter != entries.end());