sets

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeInt32 added in v1.3.0

func MergeInt32(dst, src sets.Set[int32]) sets.Set[int32]

MergeInt32 merges the src sets into dst and returns dst. This assumes that dst is non-nil. For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} MergeInt32(s1, s2) = {a1, a2, a3, a4, a5} s1 = {a1, a2, a3, a4, a5}

It supersedes s1.Union(s2) when constructing a new set is not the intention.

func MergeString added in v1.3.0

func MergeString(dst, src sets.Set[string]) sets.Set[string]

MergeString merges the src sets into dst and returns dst. This assumes that dst is non-nil. For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} MergeString(s1, s2) = {a1, a2, a3, a4, a5} s1 = {a1, a2, a3, a4, a5}

It supersedes s1.Union(s2) when constructing a new set is not the intention.

func SymmetricDifferenceString added in v1.3.0

func SymmetricDifferenceString(s1, s2 sets.Set[string]) sets.Set[string]

SymmetricDifferenceString returns the symmetric difference of two sets. For example: s1 = {a1, a2, a3} s2 = {a1, a2, a4, a5} SymmetricDifferenceString(s1, s2) = {a3, a4, a5}

It supersedes s1.Difference(s2).Union(s2.Difference(s1)) which is a little complicated and always builds several unnecessary intermediate sets.

Types

This section is empty.

Jump to

Keyboard shortcuts

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