Switch FlatMap and FlatSet to use a non-identity hasher for pointers.
Previously the default hasher for FlatMap and FlatSet used std::hash by
default. Most stdlibs' std::hash for pointers is the identity function.
This works for std::unordered_{set,map} because those are prime-sized
hashtables. But FlatSet and FlatMap are power-of-two-sized, and so the
identity function is bad, bad news.
This change also switches us to use Hash64 for strings, rather than
std::hash.
PiperOrigin-RevId: 161553663
Loading
Please sign in to comment