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>
// 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()); }
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;
}
/**
* @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.
*