Documentation ¶
Index ¶
- func InverseInPlace[T any](inp []T) []T
- func MergeSlices[T comparable](s1 []T, s2 []T) []T
- func Permutations[T any](arr []T) [][]T
- func RemoveFirstFromSliceInPlace[T comparable](inp []T, elem T) []T
- func Trim[T comparable](inp []T, cut T) []T
- func Truncate[T any](inp []T) []T
- type FixedSizePool
- type FixedSizePoolElementWrapped
- type PermutationIterator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InverseInPlace ¶
func InverseInPlace[T any](inp []T) []T
func MergeSlices ¶
func MergeSlices[T comparable](s1 []T, s2 []T) []T
func Permutations ¶
func Permutations[T any](arr []T) [][]T
func RemoveFirstFromSliceInPlace ¶
func RemoveFirstFromSliceInPlace[T comparable](inp []T, elem T) []T
func Trim ¶
func Trim[T comparable](inp []T, cut T) []T
Types ¶
type FixedSizePool ¶
type FixedSizePool[T any] struct { // contains filtered or unexported fields }
FixedSizePool is offensive concurrent-safe pool with preallocated count of elements it throws exceptions in case of:
- element leakage (if buffer is drained)
- trying to use more elements that were allocated (if buffer is drained)
- double frees (if buffer is overflowed)
func NewFixedSizePool ¶
func NewFixedSizePool[T any](new func() T, maxSize int) FixedSizePool[T]
func (*FixedSizePool[T]) Get ¶
func (f *FixedSizePool[T]) Get() T
func (*FixedSizePool[T]) GetWrapped ¶
func (f *FixedSizePool[T]) GetWrapped() FixedSizePoolElementWrapped[T]
func (*FixedSizePool[T]) Release ¶
func (f *FixedSizePool[T]) Release(elem T)
type FixedSizePoolElementWrapped ¶
type FixedSizePoolElementWrapped[T any] struct { // contains filtered or unexported fields }
func (FixedSizePoolElementWrapped[T]) Release ¶
func (e FixedSizePoolElementWrapped[T]) Release()
func (FixedSizePoolElementWrapped[T]) Unwrap ¶
func (e FixedSizePoolElementWrapped[T]) Unwrap() T
type PermutationIterator ¶
type PermutationIterator[T any] struct { // contains filtered or unexported fields }
func NewPermutationIterator ¶
func NewPermutationIterator[T any](firstPermutation []T) PermutationIterator[T]
func (*PermutationIterator[T]) Next ¶
func (iter *PermutationIterator[T]) Next() []T
Click to show internal directories.
Click to hide internal directories.