mirror of
https://github.com/ceph/ceph
synced 2025-03-06 08:20:12 +00:00
msgr: change the signature of get_myaddr()
Return a const reference to the actual address, instead of copying it. All current users are happy with this, and I can't see a good reason to copy it instead. Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
This commit is contained in:
parent
45a76eafdd
commit
5681461bf4
@ -94,7 +94,7 @@ protected:
|
||||
|
||||
// accessors
|
||||
entity_name_t get_myname() { return _my_name; }
|
||||
virtual entity_addr_t get_myaddr() = 0;
|
||||
virtual const entity_addr_t& get_myaddr() = 0;
|
||||
virtual void set_ip(entity_addr_t &addr) = 0;
|
||||
entity_inst_t get_myinst() { return entity_inst_t(get_myname(), get_myaddr()); }
|
||||
|
||||
|
@ -487,10 +487,9 @@ int SimpleMessenger::lazy_send_message(Message *m, const entity_inst_t& dest)
|
||||
return 0;
|
||||
}
|
||||
|
||||
entity_addr_t SimpleMessenger::get_myaddr()
|
||||
const entity_addr_t& SimpleMessenger::get_myaddr()
|
||||
{
|
||||
entity_addr_t a = ms_addr;
|
||||
return a;
|
||||
return ms_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
* @return A copy of he address this Messenger currently
|
||||
* believes to be its own.
|
||||
*/
|
||||
virtual entity_addr_t get_myaddr();
|
||||
virtual const entity_addr_t& get_myaddr();
|
||||
/**
|
||||
* Retrieve the Connection for an endpoint.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user