lists

package
v1.27.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: Apache-2.0, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqNoAlloc

func UniqNoAlloc[T constraints.Ordered](list []T) []T

UniqNoAlloc removes duplicates from a slice, returning it resliced. No allocations are performed, but the list gets reordered and should not be used. Ordering is required.

func UniqNoAllocByteArray

func UniqNoAllocByteArray[T ~[16]byte | ~[20]byte | ~[32]byte](list []T) []T

func UniqNoAllocBytes

func UniqNoAllocBytes[T ~[]byte](list []T) []T

func UniqNoAllocWithComparator

func UniqNoAllocWithComparator[T any](list []T, less func(a, b int) bool) []T

UniqNoAllocWithComparator removes duplicates from a slice (of some kind of ordered type). The return is resliced and entries reordered, so the original list ref should not be used. Provide the less function to compare two elements.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL