Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Visited ¶
type Visited[T comparable] struct { // contains filtered or unexported fields }
Visited is a simple object that tracks whether or not a particular value has been visited. Use this when iterating over a collection and you need to know if a value has been encountered.
CAUTION: Not concurrency safe.
func New ¶
func New[T comparable]() Visited[T]
func (*Visited[T]) Count ¶
Count returns the number of visited values.
CAUTION: Not concurrency safe.
func (*Visited[T]) PeekVisited ¶
PeekVisited returns true if the value has been visited, false otherwise. It does not add the value to the set of visited values. Use this for use cases where marking the value as visited needs to happen after processing.
CAUTION: Not concurrency safe.
Click to show internal directories.
Click to hide internal directories.