Skip to content

Commit

Permalink
Merge pull request #76 from jeschkies/karsten/use-better-sort
Browse files Browse the repository at this point in the history
Use sort.Ints for better performance.
  • Loading branch information
CharlesMasson authored Dec 29, 2023
2 parents d02c7fa + 84acf1f commit f1dba4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ddsketch/store/buffered_paginated.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func (s *BufferedPaginatedStore) compact() {
}

func (s *BufferedPaginatedStore) sortBuffer() {
sort.Slice(s.buffer, func(i, j int) bool { return s.buffer[i] < s.buffer[j] })
sort.Ints(s.buffer)
}

func (s *BufferedPaginatedStore) Add(index int) {
Expand Down

0 comments on commit f1dba4d

Please sign in to comment.