Skip to content

Commit

Permalink
Use a trivial solution to #1605
Browse files Browse the repository at this point in the history
Signed-off-by: György Krajcsovits <[email protected]>
  • Loading branch information
krajorama committed Sep 4, 2024
1 parent e061dfa commit dc819ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prometheus/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -1682,13 +1682,13 @@ func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
}

func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
n.Lock()
defer n.Unlock()

if cap(n.exemplars) == 0 {
return
}

n.Lock()
defer n.Unlock()

// The index where to insert the new exemplar.
var nIdx int = -1

Expand Down

0 comments on commit dc819ce

Please sign in to comment.