Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion count/count_min_sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (c *CountMinSketch) GetEstimate(item []byte) int64 {
hashLocations := c.getHashes(item)
estimate := int64(math.MaxInt64)
for _, h := range hashLocations {
estimate = Min(estimate, c.sketchSlice[h])
estimate = min(estimate, c.sketchSlice[h])
}
return estimate
}
Expand Down
11 changes: 1 addition & 10 deletions count/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ package count
import (
"errors"
"math"

"golang.org/x/exp/constraints"
)

func Min[T constraints.Ordered](a, b T) T {
if a < b {
return a
}
return b
}

func SuggestNumBuckets(relativeError float64) (int32, error) {
if relativeError <= 0 {
return 0, errors.New("relative error must be greater than 0.0")
Expand All @@ -42,7 +33,7 @@ func SuggestNumHashes(confidence float64) (int8, error) {
if confidence < 0 || confidence > 1.0 {
return 0, errors.New("confidence must be between 0 and 1.0 (inclusive)")
}
return Min(int8(math.Ceil(math.Log(1.0/(1.0-confidence)))), int8(math.MaxInt8)), nil
return min(int8(math.Ceil(math.Log(1.0/(1.0-confidence)))), int8(math.MaxInt8)), nil
}

func checkHeaderValidity(preamble, serVer, familyID, flagsByte byte) error {
Expand Down
Loading