omap

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IterateByValue

func IterateByValue[K cmp.Ordered, V any](omap map[K]V, lessFunc func(i, j V) bool) iterator[K, V]

Create a iterator for the map, ordered by map vlaues, using the lessFunc

func IteratorByKey

func IteratorByKey[K cmp.Ordered, V any](omap map[K]V) iterator[K, V]

Create a iterator for the map, ordered by map keys

Types

type OMap

type OMap[K cmp.Ordered, V any] map[K]V

OMap is a map with iteration order

func (OMap[K, V]) IterateByKey

func (omap OMap[K, V]) IterateByKey() iterator[K, V]

func (OMap[K, V]) IterateByValue

func (omap OMap[K, V]) IterateByValue(lessFunc func(i, j V) bool) iterator[K, V]

Create a iterator for the map, ordered by map vlaues, using the lessFunc

Jump to

Keyboard shortcuts

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