Skip to content

Commit

Permalink
chore: clean up unused code (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
proost authored and rueian committed Aug 11, 2024
1 parent 23c0c19 commit 059be73
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions valkeyprob/bloomfilter.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package valkeyprob

import (
"bufio"
"context"
"errors"
"math"
"strconv"
"strings"

"github.com/valkey-io/valkey-go"
)
Expand Down Expand Up @@ -249,25 +247,6 @@ func numberOfBloomFilterHashFunctions(s uint, n uint) uint {
return uint(math.Round(float64(s) / float64(n) * math.Log(2)))
}

func parseRedisMajorVersion(info string) int {
scanner := bufio.NewScanner(strings.NewReader(info))
for scanner.Scan() {
line := scanner.Text()
if strings.HasPrefix(line, "redis_version:") {
parts := strings.Split(strings.TrimSpace(line), ":")
if len(parts) == 2 {
ver := strings.Split(parts[1], ".")
if len(ver) == 3 {
vv, _ := strconv.ParseInt(ver[0], 10, 32)
return int(vv)
}
}
}
}

return 0
}

func (c *bloomFilter) Add(ctx context.Context, key string) error {
return c.AddMulti(ctx, []string{key})
}
Expand Down

0 comments on commit 059be73

Please sign in to comment.