Skip to content

Commit

Permalink
Add a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xichen2020 committed Jan 24, 2019
1 parent 78c1206 commit d7b71c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions query/raw_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ func (h *RawResultHeap) Pop() RawResult {
return val
}

// SortInPlace sorts the heap in place and returns the sorted data,
// with the smallest element at the end of the returned array.
// SortInPlace sorts the heap in place and returns the sorted data, with the smallest element
// at the end of the returned array. This is done by repeated swapping the smallest element with
// the last element of the current heap and shrinking the heap size.
// NB: The heap becomes invalid after this is called.
func (h *RawResultHeap) SortInPlace() []RawResult {
numElems := len(h.dv)
Expand Down

0 comments on commit d7b71c7

Please sign in to comment.