]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/rocksdb_cache: mark Shard() const
authorKefu Chai <kchai@redhat.com>
Tue, 17 Aug 2021 10:06:31 +0000 (18:06 +0800)
committerKefu Chai <tchaikov@gmail.com>
Wed, 1 Sep 2021 17:36:18 +0000 (01:36 +0800)
it does not mutate anything, so mark it `const`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/kv/rocksdb_cache/ShardedCache.h

index 674e5322fb4108e8efcde61a7f14e012601299d4..94d77759ad5997da708311494654beebe11e53f7 100644 (file)
@@ -120,7 +120,7 @@ class ShardedCache : public rocksdb::Cache, public PriorityCache::PriCache {
 //    return Hash(s.data(), s.size(), 0);
   }
 
-  uint32_t Shard(uint32_t hash) {
+  uint32_t Shard(uint32_t hash) const {
     // Note, hash >> 32 yields hash in gcc, not the zero we expect!
     return (num_shard_bits_ > 0) ? (hash >> (32 - num_shard_bits_)) : 0;
   }