From 30fe1077a8b5d07c1970c14990c8163cb11733b2 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 17:33:12 +0100 Subject: [PATCH] crushtool.cc: use !empty() instead of 'size() > 0' 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/crushtool.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crushtool.cc b/src/crushtool.cc index 3cbd915a3215e..358a07aad43fd 100644 --- a/src/crushtool.cc +++ b/src/crushtool.cc @@ -427,7 +427,7 @@ int main(int argc, const char **argv) cout << "no action specified; -h for help" << std::endl; exit(EXIT_FAILURE); } - if ((!build) && (args.size() > 0)) { + if ((!build) && (!args.empty())) { cerr << "unrecognized arguments: " << args << std::endl; exit(EXIT_FAILURE); } -- 2.39.5