diff options
| author | alex <[email protected]> | 2026-07-08 20:41:39 +0200 |
|---|---|---|
| committer | alex <[email protected]> | 2026-07-08 20:41:39 +0200 |
| commit | 2d2b8102ecc5b6a786a97c6c0fc49737c9088e63 (patch) | |
| tree | 1d8e6d18ebf3bb5528ef5f1725e63dd77f7eedc3 /shards.go | |
| parent | 1cfae9f67a9ff7240d77ece8a2e0c54326e35c66 (diff) | |
| download | redis-clone-2d2b8102ecc5b6a786a97c6c0fc49737c9088e63.tar.xz redis-clone-2d2b8102ecc5b6a786a97c6c0fc49737c9088e63.zip | |
made NumShards a global const
Diffstat (limited to 'shards.go')
| -rw-r--r-- | shards.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -15,7 +15,7 @@ func (db *RedisDB) getShard(key string)*Shard{ hash.Write([]byte(key)) val := hash.Sum64() - return db.shards[val%16] + return db.shards[val%NumShards] } func (db *RedisDB) Execute(key string, fn func(*Shard) interface{}) interface{} { |
