maps

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2024 License: MIT Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SeenMap

type SeenMap[T comparable] struct {
	// contains filtered or unexported fields
}

SeenMap is a map that keeps track of which keys have been seen.

func NewSeenMap

func NewSeenMap[T comparable]() *SeenMap[T]

NewSeenMap creates a new SeenMap.

Returns:

  • *SeenMap[T]: A pointer to the new SeenMap. Never returns nil.

func (*SeenMap[T]) FilterSeen

func (s *SeenMap[T]) FilterSeen(elems []T) []T

FilterSeen returns the elements that have not been seen.

Parameters:

  • elems: The elements to filter.

Returns:

  • []T: The elements that have not been seen.

func (*SeenMap[T]) IsSeen

func (s *SeenMap[T]) IsSeen(key T) bool

IsSeen returns true if the key has been seen.

Parameters:

  • key: The key to check.

Returns:

  • bool: True if the key has been seen, false otherwise.

func (*SeenMap[T]) See

func (s *SeenMap[T]) See(key T)

See marks the key as seen.

Parameters:

  • key: The key to mark as seen.

Jump to

Keyboard shortcuts

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