@@ -359,12 +359,12 @@ func (s *shard[K, V]) putGhostEntry(e *ghostEntry[K]) {
359359 s .freeGhostEntries = e
360360}
361361
362- // getShard returns the shard for a given key using type-optimized hashing.
362+ // shard returns the shard for a given key using type-optimized hashing.
363363// Uses bitwise AND with shardMask for fast modulo (numShards must be power of 2).
364364// Fast paths for int, int64, and string keys avoid the type switch overhead entirely.
365365//
366366//go:nosplit
367- func (c * s3fifo [K , V ]) getShard (key K ) * shard [K , V ] {
367+ func (c * s3fifo [K , V ]) shard (key K ) * shard [K , V ] {
368368 // Fast path for int keys (most common case in benchmarks).
369369 // The keyIsInt flag is set once at construction, so this branch is predictable.
370370 if c .keyIsInt {
@@ -404,7 +404,7 @@ func (c *s3fifo[K, V]) shardIndexSlow(key K) uint64 {
404404// get retrieves a value from the cache.
405405// On hit, increments frequency counter (used during eviction).
406406func (c * s3fifo [K , V ]) get (key K ) (V , bool ) {
407- return c .getShard (key ).get (key )
407+ return c .shard (key ).get (key )
408408}
409409
410410func (s * shard [K , V ]) get (key K ) (V , bool ) {
@@ -435,7 +435,7 @@ func (s *shard[K, V]) get(key K) (V, bool) {
435435// getOrSet retrieves a value or sets it if not found, in a single operation.
436436// Returns the value and true if found, or sets the value and returns false.
437437func (c * s3fifo [K , V ]) getOrSet (key K , value V , expiryNano int64 ) (V , bool ) {
438- return c .getShard (key ).getOrSet (key , value , expiryNano )
438+ return c .shard (key ).getOrSet (key , value , expiryNano )
439439}
440440
441441func (s * shard [K , V ]) getOrSet (key K , value V , expiryNano int64 ) (V , bool ) {
@@ -512,7 +512,7 @@ func (s *shard[K, V]) getOrSet(key K, value V, expiryNano int64) (V, bool) {
512512// set adds or updates a value in the cache.
513513// expiryNano is Unix nanoseconds; 0 means no expiry.
514514func (c * s3fifo [K , V ]) set (key K , value V , expiryNano int64 ) {
515- c .getShard (key ).set (key , value , expiryNano )
515+ c .shard (key ).set (key , value , expiryNano )
516516}
517517
518518func (s * shard [K , V ]) set (key K , value V , expiryNano int64 ) {
@@ -563,7 +563,7 @@ func (s *shard[K, V]) set(key K, value V, expiryNano int64) {
563563
564564// del removes a value from the cache.
565565func (c * s3fifo [K , V ]) del (key K ) {
566- c .getShard (key ).delete (key )
566+ c .shard (key ).delete (key )
567567}
568568
569569func (s * shard [K , V ]) delete (key K ) {
0 commit comments