Skip to contentSkip to conversation

monmap: clear addr_name map on calculating ranks

PATCH Applied Henry C Chang 1 participant 1 message Dec 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 monmap: clear addr_name map on calculating ranks

We should clear addr_name before filling it. Otherwise, the removed mon will stay there and cause incorrect rank assignment.

---
 src/mon/MonMap.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
src/mon/MonMap.h +1 -0
index 651a146..ffeb572 100644
@@ -40,6 +40,7 @@ class MonMap {
   void calc_ranks() {
     rank_name.resize(mon_addr.size());
     rank_addr.resize(mon_addr.size());
+    addr_name.clear();
     for (map<string,entity_addr_t>::iterator p = mon_addr.begin();
 	 p != mon_addr.end();
 	 p++) {
Signature · 1 line
1.7.4.1