3 ms·
I think that's backwards: a hash set implementation can be used as a hash map simply by storing objects whose comparison is limited to their key fields. A hash
by userbinator 12y ago
I think that's backwards: a hash set implementation can be used as a hash map simply by storing objects whose comparison is limited to their key fields. A hash map with values that are all the same and never used just seems like a waste.
- pcwalton 12y agoIt's not a waste, because the fact that unit is zero-sized makes it boil away to nothing at runtime.