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:56:22 -0700
commit7c1d2ded8fa8061bf3f14932800998b963745dd1 (patch)
tree41d083a8bcaaa1416d3b630e874dad4ef3a2e398
parent532e41a9985a16b35a6e49cdcba38af0ad166fa8 (diff)
downloadceph-7c1d2ded8fa8061bf3f14932800998b963745dd1.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>
-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());