@@ -434,11 +434,11 @@ class Segment {
434434
435435 template <bool UV = kUseVersion >
436436 std::enable_if_t <UV, uint64_t > GetVersion (PhysicalBid bid) const {
437- return bucket_[ bid] .GetVersion ();
437+ return GetBucket ( bid) .GetVersion ();
438438 }
439439
440440 template <bool UV = kUseVersion > std::enable_if_t <UV> SetVersion (PhysicalBid bid, uint64_t v) {
441- return bucket_[ bid] .SetVersion (v);
441+ return GetBucket ( bid) .SetVersion (v);
442442 }
443443
444444 // Traverses over Segment's bucket bid and calls cb(const Iterator& it) 0 or more times
@@ -1304,6 +1304,7 @@ void Segment<Key, Value, Policy>::Split(HFunc&& hfn, Segment* dest_right) {
13041304
13051305template <typename Key, typename Value, typename Policy>
13061306int Segment<Key, Value, Policy>::MoveToOther(bool own_items, unsigned from_bid, unsigned to_bid) {
1307+ assert (from_bid < kBucketNum && to_bid < kBucketNum );
13071308 auto & src = bucket_[from_bid];
13081309 uint32_t mask = src.GetProbe (!own_items);
13091310 if (mask == 0 ) {
@@ -1519,7 +1520,8 @@ void Segment<Key, Value, Policy>::TraverseBucket(PhysicalBid bid, Cb&& cb) {
15191520
15201521template <typename Key, typename Value, typename Policy>
15211522template <typename Cb, typename HashFn>
1522- bool Segment<Key, Value, Policy>::TraverseLogicalBucket(uint8_t bid, HashFn&& hfun, Cb&& cb) const {
1523+ bool Segment<Key, Value, Policy>::TraverseLogicalBucket(LogicalBid bid, HashFn&& hfun,
1524+ Cb&& cb) const {
15231525 assert (bid < kBucketNum );
15241526
15251527 const Bucket& b = bucket_[bid];
@@ -1673,12 +1675,12 @@ auto Segment<Key, Value, Policy>::BumpUp(uint8_t bid, SlotId slot, Hash_t key_ha
16731675
16741676 // update ptr for swapped items
16751677 if (is_probing) {
1676- unsigned prev_bid = PrevBid (swap_bid);
1678+ LogicalBid prev_bid = PrevBid (swap_bid);
16771679 auto & prevb = bucket_[prev_bid];
16781680 prevb.SetStashPtr (stash_pos, swap_fp, &swapb);
16791681 } else {
16801682 // stash_ptr resides in the current or the next bucket.
1681- unsigned next_bid = NextBid (swap_bid);
1683+ LogicalBid next_bid = NextBid (swap_bid);
16821684 swapb.SetStashPtr (stash_pos, swap_fp, bucket_ + next_bid);
16831685 }
16841686
0 commit comments