]> git.apps.os.sepia.ceph.com Git - ceph-ci.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:19:11 +0000 (11:19 -0400)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mgr/ActivePyModules.cc

index a5589062e99dccc86d6ceaba2e097cc138824593..4981a53b8db122920f1381c2679d28f3aa15b6c7 100644 (file)
@@ -432,11 +432,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();