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-20 08:58:11 -0700
commita992664435db9dde3745eb7f354cce3fc5400a47 (patch)
treea5bf41ebc2bd1f857c04f0e235aac950b27f8da4
parent788546ea71c994ff35323747294ed9c177fe7020 (diff)
downloadceph-a992664435db9dde3745eb7f354cce3fc5400a47.tar.gz
lru_map: don't use list::size()
replace list::size() with map::size(), which should have a constant time complexity. Reviewed-by: Sage Weil <sage@inktank.com> Signed-off-by: Yehuda Sadeh <yehuda@inktank.com> (cherry picked from commit 7c1d2ded8fa8061bf3f14932800998b963745dd1)
-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());