abseil / abseil/abseil-cpp

Error in reset_ctrl ?

Open
#334 4 comments 0 reactions 1 assignee Claimed by @fowles View on GitHub
Dominant language
C++
Stars
18.1k
Forks
3.2k
Avg merge
20h 36m
Merged PRs (30d)
1

Description

https://github.com/abseil/abseil-cpp/blob/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f/absl/container/internal/raw_hash_set.h#L1717

The length of ctrl_ is capacity + width + 1, and your comment says set it all to empty, except the last element, to sentinel.
You are setting it all to empty, except the last element, but instead of setting the last element to sentinel, you are ignoring width.
So:
ctrl_[capacity_] = kSentinel;
==>
ctrl_[capacity_ + Group::kWidth] = kSentinel;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.