]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ActivePyModules: streamline mgr_ips a bit
authorSage Weil <sage@newdream.net>
Wed, 30 Jun 2021 13:03:13 +0000 (09:03 -0400)
committerSage Weil <sage@newdream.net>
Wed, 30 Jun 2021 15:20:13 +0000 (11:20 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 49d5a5bdea2ca925ee5030d19d3793927c2a1fbd)

src/mgr/ActivePyModules.cc

index 3d924d0ca5dcdfa61441e9bc8fb2c4fbecb9f91b..67fe1d44b6d9c6ae1bbf4e81afe33c40b853a549 100644 (file)
@@ -493,11 +493,9 @@ PyObject *ActivePyModules::get_python(const std::string &what)
     std::set<std::string> did;
     for (auto& i : myaddrs.v) {
       std::string ip = i.ip_only_to_str();
-      if (did.count(ip)) {
-       continue;
+      if (auto [where, inserted] = did.insert(ip); inserted) {
+       f.dump_string("ip", ip);
       }
-      did.insert(ip);
-      f.dump_string("ip", ip);
     }
     f.close_section();
     return f.get();