Commit e42d033d authored by root's avatar root

a bug fix

parent 3690d3ba
......@@ -177,8 +177,9 @@ int64_t WeightedRoundRobinLoadBalancer::GetBestServer(
if (tls.HasRemainServer()) {
final_server = tls.remain_server.first;
} else {
final_server = tls.position == 0 ? server_list.size() -1
: tls.position -1;
size_t index = tls.position == 0 ? server_list.size() - 1
: tls.position - 1;
final_server = server_list[index].first;
}
return final_server;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment