From 6f0175e5a95a6c1d7bc7baac6381256ea80f0f52 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 14:41:04 +0100 Subject: [PATCH] OSDMonitor.cc: use !empty() instead of size() Use empty() since it should be prefered as it has, following the standard, a constant time complexity regardless of the containter type. The same is not guaranteed for size(). Signed-off-by: Danny Al-Gaaf --- src/mon/OSDMonitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f889f25166f44..9c094307e4cc6 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -248,7 +248,7 @@ bool OSDMonitor::thrash() if (std::find(v.begin(), v.end(), *q) == v.end()) v.push_back(*q); } - if (v.size()) + if (!v.empty()) pending_inc.new_pg_temp[p->first] = v; dout(5) << "thrash_map pg " << p->first << " pg_temp remapped to " << v << dendl; -- 2.39.5