mirror of
https://github.com/ceph/ceph
synced 2025-01-21 02:31:19 +00:00
ceph_mon.cc: replace string::find() with compare()
Fix for: [src/ceph_mon.cc:396]: (performance) Inefficient usage of string::find() in condition; string::compare() would be faster. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
30162870fd
commit
fd8f18ac35
@ -393,7 +393,7 @@ int main(int argc, const char **argv)
|
||||
string name;
|
||||
monmap.get_addr_name(local, name);
|
||||
|
||||
if (name.find("noname-") == 0) {
|
||||
if (name.compare(0, 7, "noname-") == 0) {
|
||||
cout << argv[0] << ": mon." << name << " " << local
|
||||
<< " is local, renaming to mon." << g_conf->name.get_id() << std::endl;
|
||||
monmap.rename(name, g_conf->name.get_id());
|
||||
|
Loading…
Reference in New Issue
Block a user