Skip to content
This repository has been archived by the owner on Oct 17, 2018. It is now read-only.

Commit

Permalink
Fix pathological case triggering quadratic runtime for merging sorted…
Browse files Browse the repository at this point in the history
… lists
  • Loading branch information
xichen2020 committed Jun 2, 2017
1 parent 05ee6a1 commit 60d2e41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion aggregation/quantile/cm/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ func (s *stream) insert() {
return
}

for s.bufMore.Len() > 0 && s.bufMore.Min() > s.samples.Back().value {
for s.bufMore.Len() > 0 && s.bufMore.Min() >= s.samples.Back().value {
sample := s.acquireSampleFn()
sample.setData(s.bufMore.Pop(), 1, 0)
s.samples.PushBack(sample)
Expand Down

0 comments on commit 60d2e41

Please sign in to comment.