utilsort

package
v0.0.0-...-aca9518 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByKey

func ByKey[T any, K cmp.Ordered](slice []T, keyFn func(T) K)

func LeftZip

func LeftZip[Key cmp.Ordered, Left any, Right any](
	leftSlice []Left,
	leftKeyFn func(Left) Key,
	rightSlice []Right,
	rightKeyFn func(Right) Key,
) iter.Iter[LeftZipItem[Left, Right]]

Zip-iter two sorted slices, yielding each element of leftSlice exactly once, together with a rightSlice element with the same key if available. If the same key appears in rightSlice multiple times, only the first occurrence may get yielded.

Types

type LeftZipItem

type LeftZipItem[Left any, Right any] struct {
	Left  Left
	Right optional.Optional[Right]
}

Jump to

Keyboard shortcuts

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