You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Vanjikumaran Sivajothy (JIRA)" <ji...@apache.org> on 2016/11/21 22:24:58 UTC

[jira] [Created] (SYNAPSE-1061) WeightedRRLCAlgorithm Unwanted condition

Vanjikumaran Sivajothy created SYNAPSE-1061:
-----------------------------------------------

             Summary:  WeightedRRLCAlgorithm Unwanted condition
                 Key: SYNAPSE-1061
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-1061
             Project: Synapse
          Issue Type: Bug
            Reporter: Vanjikumaran Sivajothy
            Assignee: Hiranya Jayathilaka


 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.

{code}
 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;
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org