hack

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0, MIT, MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LoadFactorNum is the numerator of load factor
	LoadFactorNum = 13
	// LoadFactorDen is the denominator of load factor
	LoadFactorDen = 2
)

LoadFactor is the maximum average load of a bucket that triggers growth is 6.5 in Golang Map. Represent as LoadFactorNum/LoadFactorDen, to allow integer math. They are from the golang definition. ref: https://github.com/golang/go/blob/go1.13.15/src/runtime/map.go#L68-L71

Variables

This section is empty.

Functions

func Slice

func Slice(s string) (b []byte)

Slice converts string to slice without copy. Use at your own risk.

Types

type MutableString

type MutableString string

MutableString can be used as string via string(MutableString) without performance loss.

func String

func String(b []byte) (s MutableString)

String converts slice to MutableString without copy. The MutableString can be converts to string without copy. Use it at your own risk.

Jump to

Keyboard shortcuts

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