Review and improve HashMap's handling of an empty table #53853
Labels
A-collections
Area: `std::collections`
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
In #53804, I fixed the most immediate problem arising from how
HashMap
handles the empty table, but @gnzlbg still (rightly) sees more problems. We still use1
instead ofNonNull::dangling()
as value forEMPTY
, andptr()
even tests equality withEMPTY
to return NULL instead. We can't really use non-NULL pointers as sentinel values like that, and NULL is often a worse choice than an aligned dangling pointer because the latter are at least valid for zero-sized operations.See here for @gnzlbg's suggestions.
The text was updated successfully, but these errors were encountered: