summaryrefslogtreecommitdiffstats
path: root/src/mon/MonMap.h
diff options
context:
space:
mode:
authorSamuel Just <samuel.just@dreamhost.com>2011-02-03 20:35:47 +0100
committerSamuel Just <samuel.just@dreamhost.com>2011-02-03 20:35:47 +0100
commit02ce7348bd75e7ab36c52856fda733f7df85ef18 (patch)
tree9e7df63947b5dd71efe050be3b0e565f17cdd503 /src/mon/MonMap.h
parentSimpleMessenger: learned_addr can take a const ref (diff)
downloadceph-02ce7348bd75e7ab36c52856fda733f7df85ef18.tar.xz
ceph-02ce7348bd75e7ab36c52856fda733f7df85ef18.zip
MonMap: add,remove,contains can take const references
Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Diffstat (limited to 'src/mon/MonMap.h')
-rw-r--r--src/mon/MonMap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h
index bd28c189a4e..16d52dfd5d1 100644
--- a/src/mon/MonMap.h
+++ b/src/mon/MonMap.h
@@ -72,13 +72,13 @@ class MonMap {
epoch_t get_epoch() { return epoch; }
- void add(string name, entity_addr_t addr) {
+ void add(const string &name, const entity_addr_t &addr) {
assert(mon_addr.count(name) == 0);
mon_addr[name] = addr;
calc_ranks();
}
- void remove(string name) {
+ void remove(const string &name) {
assert(mon_addr.count(name));
mon_addr.erase(name);
calc_ranks();
@@ -88,7 +88,7 @@ class MonMap {
return mon_addr.count(name);
}
- bool contains(entity_addr_t a) {
+ bool contains(const entity_addr_t &a) {
for (map<string,entity_addr_t>::iterator p = mon_addr.begin();
p != mon_addr.end();
p++)