File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include < Storages/Cache/ObjectStorageListObjectsCache.h>
2
+ #include < boost/functional/hash.hpp>
2
3
3
4
namespace DB
4
5
{
@@ -146,7 +147,12 @@ bool ObjectStorageListObjectsCache::Key::operator==(const Key & other) const
146
147
147
148
size_t ObjectStorageListObjectsCache::KeyHasher::operator ()(const Key & key) const
148
149
{
149
- return std::hash<String>()(key.prefix ) + std::hash<String>()(key.bucket );
150
+ std::size_t seed = 0 ;
151
+
152
+ hash_combine (seed, std::hash<String>()(key.bucket ));
153
+ hash_combine (seed, std::hash<String>()(key.prefix ));
154
+
155
+ return seed;
150
156
}
151
157
152
158
bool ObjectStorageListObjectsCache::IsStale::operator ()(const Key & key) const
@@ -160,7 +166,7 @@ size_t ObjectStorageListObjectsCache::WeightFunction::operator()(const Value & v
160
166
161
167
for (const auto & object : value)
162
168
{
163
- weight += object->relative_path .size () + sizeof (ObjectMetadata);
169
+ weight += object->relative_path .capacity () + sizeof (ObjectMetadata);
164
170
}
165
171
166
172
return weight;
You can’t perform that action at this time.
0 commit comments