MCPcopy Create free account
hub / github.com/KDE/kdevelop / walkBucketChain

Method walkBucketChain

kdevplatform/serialization/itemrepository.h:2062–2077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2060 */
2061 template <typename Visitor>
2062 auto walkBucketChain(unsigned int hash, const Visitor& visitor) const->decltype(visitor(0, nullptr))
2063 {
2064 unsigned short bucketIndex = m_firstBucketForHash[hash % bucketHashSize];
2065
2066 while (bucketIndex) {
2067 auto* bucketPtr = bucketForIndex(bucketIndex);
2068
2069 if (auto visitResult = visitor(bucketIndex, bucketPtr)) {
2070 return visitResult;
2071 }
2072
2073 bucketIndex = bucketPtr->nextBucketForHash(hash);
2074 }
2075
2076 return {}; // clazy:exclude=returning-void-expression
2077 }
2078
2079 ///Makes sure the order within m_freeSpaceBuckets is correct, after largestFreeSize has been changed for m_freeSpaceBuckets[index].
2080 ///If too few space is free within the given bucket, it is removed from m_freeSpaceBuckets.

Callers

nothing calls this directly

Calls 1

nextBucketForHashMethod · 0.80

Tested by

no test coverage detected