uint64set

package
v1.28.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	// contains filtered or unexported fields
}

Set is a fast set for uint64.

It should work faster than map[uint64]struct{} for semi-sparse uint64 values such as MetricIDs generated by lib/storage.

It is unsafe calling Set methods from concurrent goroutines.

func (*Set) Add

func (s *Set) Add(x uint64)

Add adds x to s.

func (*Set) AppendTo

func (s *Set) AppendTo(dst []uint64) []uint64

AppendTo appends all the items from the set to dst and returns the result.

The returned items are sorted.

func (*Set) Clone

func (s *Set) Clone() *Set

Clone returns an independent copy of s.

func (*Set) Del

func (s *Set) Del(x uint64)

Del deletes x from s.

func (*Set) Has

func (s *Set) Has(x uint64) bool

Has verifies whether x exists in s.

func (*Set) Len

func (s *Set) Len() int

Len returns the number of distinct uint64 values in s.

Jump to

Keyboard shortcuts

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