From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 13:41:04 +0000 (+0100) Subject: OSDMonitor.cc: use !empty() instead of size() X-Git-Tag: v0.58~66^2~53 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6f0175e5a95a6c1d7bc7baac6381256ea80f0f52;p=ceph.git 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 --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index f889f25166f..9c094307e4c 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;