Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
was going through with WeightedRRLCAlgorithm and noticed that useless condition used in reCalcuateWeight(). Why do we need that condition over there and it is already known that totalConnections is not a zero.
public void reCalcuateWeight() { if (totalConnections > 0) { double weightRatio = (double) fixedWeight / totalWeight; double connectionRatio; if (totalConnections != 0) { //useless condition...?? connectionRatio = (double) currentConnectionCount / totalConnections; } else { connectionRatio = 0; } double diff = weightRatio - connectionRatio;