Documentation
¶
Overview ¶
Package sort has sort functions used by Agent.
Index ¶
Constants ¶
View Source
const InsertionSortThreshold = 40
InsertionSortThreshold is the slice size after which we should consider using the stdlib sort method instead of the InsertionSort implemented below.
Variables ¶
This section is empty.
Functions ¶
func InsertionSort ¶
func InsertionSort(elements []string)
InsertionSort sorts in-place the given elements, not doing any allocation. It is very efficient for on slices but if memory allocation is not an issue, consider using the stdlib `sort.Sort` method on slices having a size > InsertionSortThreshold. See `pkg/util/sort_benchmarks_note.md` for more details.
func UniqInPlace ¶
UniqInPlace sorts and remove duplicates from elements in place The returned slice is a subslice of elements
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.