]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/test_cors.cc: use empty() over length() for emptiness check
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 25 Apr 2018 20:26:20 +0000 (22:26 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 26 Apr 2018 10:17:54 +0000 (12:17 +0200)
Fix for:
[src/test/test_cors.cc:117]: (style) Checking if unsigned
 variable 'host.length()' is less than zero.
[src/test/test_cors.cc:118]: (style) Checking if unsigned
 variable 'creds.length()' is less than zero.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/test_cors.cc

index 79490e30d4ae48b0578fce0bae9ab48d187d2987..d9c6e5796635ec82f01fb93b360fa290b0c6702f 100644 (file)
@@ -114,8 +114,7 @@ int test_cors_helper::extract_input(unsigned argc, char *argv[]){
       ERR_CHECK_NEXT_PARAM(port);
     }else return -1;
   }
-  if(host.length() <= 0 ||
-     creds.length() <= 0)
+  if(host.empty() || creds.empty())
     return -1;
   return 0;
 }