From: Danny Al-Gaaf Date: Thu, 29 Oct 2015 05:19:49 +0000 (+0100) Subject: rbd-replay-prep.cc: replace inefficient string::find() w/ compare() X-Git-Tag: v10.0.4~86^2~37 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e892f9aa29bd2dc1ad49ade96e7f236083f9f34f;p=ceph.git rbd-replay-prep.cc: replace inefficient string::find() w/ compare() Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rbd_replay/rbd-replay-prep.cc b/src/rbd_replay/rbd-replay-prep.cc index 647a5e380631..c887813a5565 100644 --- a/src/rbd_replay/rbd-replay-prep.cc +++ b/src/rbd_replay/rbd-replay-prep.cc @@ -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;