From 11c485a5eddf3b49380cadc0de835ff5a0a51625 Mon Sep 17 00:00:00 2001 From: FabioCircle Date: Mon, 15 Nov 2021 23:14:54 +0800 Subject: [PATCH] Duplicate temporary variable (#1244) Co-authored-by: fabiowzhang --- core/hash/consistenthash_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/hash/consistenthash_test.go b/core/hash/consistenthash_test.go index 989a8d51..8d36366e 100644 --- a/core/hash/consistenthash_test.go +++ b/core/hash/consistenthash_test.go @@ -74,12 +74,12 @@ func TestConsistentHashIncrementalTransfer(t *testing.T) { laterCh := create() laterCh.AddWithWeight(node, 10*(i+1)) - for i := 0; i < requestSize; i++ { - key, ok := laterCh.Get(requestSize + i) + for j := 0; j < requestSize; j++ { + key, ok := laterCh.Get(requestSize + j) assert.True(t, ok) assert.NotNil(t, key) value := key.(string) - assert.True(t, value == keys[i] || value == node) + assert.True(t, value == keys[j] || value == node) } } }