Skip to content

Commit

Permalink
fix(tsdb): Fix variables masked by a declaration (#18129)
Browse files Browse the repository at this point in the history
Before this commit, the to and from variables were being re-declared in
a block in such a way that the values were not being used.

This patch uses regular assignment so that the values are visable
outside of the block where they're set.

Closes: 18128
  • Loading branch information
ayang64 authored May 18, 2020
1 parent 0cb09dd commit 4cbc6a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tsdb/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ func testStoreCardinalityDuplicates(t *testing.T, store *Store) {
// For other shards we write a random sub-section of all the points.
// which will duplicate the series and shouldn't increase the
// cardinality.
from, to := rand.Intn(len(points)), rand.Intn(len(points))
from, to = rand.Intn(len(points)), rand.Intn(len(points))
if from > to {
from, to = to, from
}
Expand Down

0 comments on commit 4cbc6a4

Please sign in to comment.