Skip to content

Commit

Permalink
fix: correct use of atomic int (#12225)
Browse files Browse the repository at this point in the history
  • Loading branch information
poyzannur authored Mar 15, 2024
1 parent b926688 commit 3dd5b70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/iter/sample_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ func NewSeriesIterator(series logproto.Series) SampleIterator {
}

func (i *seriesIterator) Next() bool {
i.i.Inc()
return int(i.i.Load()) < len(i.series.Samples)
tmp := i.i.Add(1)
return int(tmp) < len(i.series.Samples)
}

func (i *seriesIterator) Error() error {
Expand Down

0 comments on commit 3dd5b70

Please sign in to comment.