Skip to content

Commit

Permalink
remove unimportant examples
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu authored Feb 16, 2024
1 parent a9d9db5 commit f0aea29
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,6 @@ func main() {
}
```

Using a customized shards count.
```go
cache := lru.New[string, int](8192, lru.WithShards[string, int](64))

cache.Set("foobar", 42, 3*time.Second)
println(cache.Get("foobar"))
```

Using a customized hasher function.
```go
hasher := func(key string) (hash uint64) {
hash = 5381
for _, c := range []byte(key) {
hash = hash*33 + uint64(c)
}
return
}

cache := lru.New[string, int](8192, lru.WithHasher[string, int](hasher))

cache.Set("foobar", 42, 3*time.Second)
println(cache.Get("foobar"))
```

Using as a sliding cache.
```go
cache := lru.New[string, int](8192, lru.WithSilding(true))
Expand Down

0 comments on commit f0aea29

Please sign in to comment.