]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/MgrMap: let get_active_addrs() return a const ref
authorKefu Chai <kchai@redhat.com>
Sat, 25 Jul 2020 05:02:49 +0000 (13:02 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 27 Jul 2020 03:29:10 +0000 (11:29 +0800)
no need to create a temporary instance for referencing those addresses.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MgrMap.h

index 37be5c3c1c4413828f776c411b00d8db5dd936ce..d43d9336c4e1fdc5c568161f5884c88c464475f0 100644 (file)
@@ -259,7 +259,7 @@ public:
 
   epoch_t get_epoch() const { return epoch; }
   epoch_t get_last_failure_osd_epoch() const { return last_failure_osd_epoch; }
-  entity_addrvec_t get_active_addrs() const { return active_addrs; }
+  const entity_addrvec_t& get_active_addrs() const { return active_addrs; }
   uint64_t get_active_gid() const { return active_gid; }
   bool get_available() const { return available; }
   const std::string &get_active_name() const { return active_name; }