]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: adjust_osd_weights: small const cleanup
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 9 Dec 2010 23:31:16 +0000 (15:31 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Fri, 14 Jan 2011 11:14:51 +0000 (03:14 -0800)
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
src/osd/OSDMap.h

index fdbfb4a932a019a8a84b428a58e5e61f1bdeddff..864f7ab037afe608acaee5b8c47389d0413dbef2 100644 (file)
@@ -403,14 +403,18 @@ private:
   float get_weightf(int o) const {
     return (float)get_weight(o) / (float)CEPH_OSD_IN;
   }
-  void adjust_osd_weights(map<int,double>& weights, Incremental& inc) {
+  void adjust_osd_weights(const map<int,double>& weights, Incremental& inc) const {
     float max = 0;
-    for (map<int,double>::iterator p = weights.begin(); p != weights.end(); p++)
+    for (map<int,double>::const_iterator p = weights.begin();
+        p != weights.end(); ++p) {
       if (p->second > max)
        max = p->second;
+    }
 
-    for (map<int,double>::iterator p = weights.begin(); p != weights.end(); p++)
+    for (map<int,double>::const_iterator p = weights.begin();
+        p != weights.end(); ++p) {
       inc.new_weight[p->first] = (unsigned)((p->second / max) * CEPH_OSD_IN);
+    }
   }