From dd855b3ee28a6ffc32d7a01819abb7cd40c00e6e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 14:46:05 +0100 Subject: [PATCH] monmaptool.cc: use empty() instead of size() to check for emptiness 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/monmaptool.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monmaptool.cc b/src/monmaptool.cc index 5870e5f81ad..e15e42b2ca8 100644 --- a/src/monmaptool.cc +++ b/src/monmaptool.cc @@ -91,7 +91,7 @@ int main(int argc, const char **argv) ++i; } } - if (args.size() < 1) { + if (args.empty()) { cerr << me << ": must specify monmap filename" << std::endl; usage(); } @@ -147,7 +147,7 @@ int main(int argc, const char **argv) // apply initial members list initial_members; get_str_list(g_conf->mon_initial_members, initial_members); - if (initial_members.size()) { + if (!initial_members.empty()) { cout << "initial_members " << initial_members << ", filtering seed monmap" << std::endl; set removed; monmap.set_initial_members(g_ceph_context, initial_members, -- 2.47.3