[Webkit-unassigned] [Bug 205449] Allow Vectors as hash keys

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 19 11:39:23 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=205449

--- Comment #13 from Saam Barati <sbarati at apple.com> ---
(In reply to Antti Koivisto from comment #5)
> > I see this now. I’m not a huge fan of this. What if there is a scenario
> > where empty vector is a legit key? Maybe just make the empty value Max - 1
> > and nullptr
> 
> Things are simpler and more understandable if the empty value is a regular
> valid value. I think for types that have well-defined "empty" it is better
> to stick with that.
> 
> This can be reconsider if a use case where this matters appears.

Why introduce this footgun? We already know from experience people want to put nullptr, zero, etc, in hash tables as keys. I don't see why we wouldn't also want an empty vector. I don't understand why having a well-defined "empty" is any more important than a well defined "deleted" value? If we're introducing something new, we might as well introduce it without the footgun.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191219/8fe2cd84/attachment.htm>


More information about the webkit-unassigned mailing list