Skip to content

Commit 8dc6502

Browse files
authored
Fix UpstreamPolicie: use size_t when counting for cur_idx. (#1809)
1 parent c46d6b8 commit 8dc6502

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/nameservice/UpstreamPolicies.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,8 @@ void UPSWeightedRandomPolicy::fuse_one_server(const EndpointAddress *addr)
612612
EndpointAddress *UPSVNSWRRPolicy::first_strategy(const ParsedURI& uri,
613613
WFNSTracing *tracing)
614614
{
615-
int idx = this->cur_idx.fetch_add(1);
616-
int pos = 0;
615+
size_t idx = this->cur_idx.fetch_add(1);
616+
size_t pos = 0;
617617
for (int i = 0; i < this->total_weight; i++, idx++)
618618
{
619619
pos = this->pre_generated_vec[idx % this->pre_generated_vec.size()];

0 commit comments

Comments
 (0)