Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PushOrReplace ¶
func PushOrReplace[T SliceHeapItem[T]](h *SliceHeap[T], item T)
func Unique ¶
func Unique[T comparable](slice []T) []T
Unique returns a new slice containing only the unique values from the input slice. The function preserves the original order of elements.
Types ¶
type SliceHeap ¶
type SliceHeap[T SliceHeapItem[T]] []T
type SliceHeapItem ¶
type SlicesPool ¶
type SlicesPool[T any] struct { // contains filtered or unexported fields }
func NewSlicesPool ¶
func NewSlicesPool[T any](size int) *SlicesPool[T]
func (*SlicesPool[T]) Get ¶
func (sp *SlicesPool[T]) Get(size int) *[]T
func (*SlicesPool[T]) Put ¶
func (sp *SlicesPool[T]) Put(s *[]T)
Click to show internal directories.
Click to hide internal directories.