[MINOR] changed server weight storage from char to unsigned int
This change does not affect memory usage much, but it simplifies the
code a lot by removing many +1/-1 operations on weights.
diff --git a/src/backend.c b/src/backend.c
index 0918a0b..309bee1 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -59,10 +59,10 @@
if (srv->state & SRV_RUNNING) {
if (srv->state & SRV_BACKUP) {
px->srv_bck++;
- px->tot_wbck += srv->eweight + 1;
+ px->tot_wbck += srv->eweight;
} else {
px->srv_act++;
- px->tot_wact += srv->eweight + 1;
+ px->tot_wact += srv->eweight;
}
}
}
@@ -117,7 +117,7 @@
break;
}
- cur->wscore += cur->eweight + 1;
+ cur->wscore += cur->eweight;
v = (cur->wscore + tot) / tot; /* result between 0 and 3 */
if (best == NULL || v > max) {
max = v;