mengle-yang commented on code in PR #13949: URL: https://github.com/apache/dubbo/pull/13949#discussion_r1533035500
########## dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/RandomLoadBalance.java: ########## @@ -69,13 +69,14 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation int totalWeight = 0; for (int i = 0; i < length; i++) { int weight = getWeight(invokers.get(i), invocation); + // judge before accumulation + if (sameWeight && totalWeight != weight * i) { + sameWeight = false; + } Review Comment: we don't need a external addition operation -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org