]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-replay-prep.cc: replace inefficient string::find() w/ compare()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 29 Oct 2015 05:19:49 +0000 (06:19 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 29 Jan 2016 20:51:17 +0000 (21:51 +0100)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rbd_replay/rbd-replay-prep.cc

index 647a5e3806319e7ccc36c897716d180aea0bf012..c887813a5565708e5214fc96823287ab0b265064 100644 (file)
@@ -153,7 +153,7 @@ public:
          usage_exit(args[0], "--window requires an argument");
        }
        m_window = (uint64_t)(1e9 * atof(args[++i].c_str()));
-      } else if (arg.find("--window=") == 0) {
+      } else if (arg.compare(0, 9, "--window=") == 0) {
        m_window = (uint64_t)(1e9 * atof(arg.c_str() + sizeof("--window=")));
       } else if (arg == "--anonymize") {
        m_anonymize = true;
@@ -162,7 +162,7 @@ public:
       } else if (arg == "-h" || arg == "--help") {
        usage(args[0]);
        exit(0);
-      } else if (arg.find("-") == 0) {
+      } else if (arg.compare(0, 1, "-") == 0) {
        usage_exit(args[0], "Unrecognized argument: " + arg);
       } else if (!got_input) {
        input_file_name = arg;