]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/msg_types: entity_addrvec_t contains() and is_same_host()
authorSage Weil <sage@redhat.com>
Wed, 30 May 2018 20:15:54 +0000 (15:15 -0500)
committerSage Weil <sage@redhat.com>
Fri, 1 Jun 2018 13:08:20 +0000 (08:08 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/msg_types.h

index 736e96366538347c29ff19986eba4efd35ac4640..61715b4be8a897ea46b956206dfc007275e900b9 100644 (file)
@@ -582,6 +582,22 @@ struct entity_addrvec_t {
     }
     return true;
   }
+  bool contains(const entity_addr_t& a) const {
+    for (auto& i : v) {
+      if (a == i) {
+       return true;
+      }
+    }
+    return false;
+  }
+  bool is_same_host(const entity_addr_t& a) const {
+    for (auto& i : v) {
+      if (i.is_same_host(a)) {
+       return true;
+      }
+    }
+    return false;
+  }
 
   friend ostream& operator<<(ostream& out, const entity_addrvec_t& av) {
     if (av.v.empty()) {