Hashing-free constructor copy of HashMaps
When creating a new HashMap from existing HashMap, the existing implementation is pretty generic: allocates the HashMap of the right capacity and loops over the input to put all entries.
However, if the input argument is exactly of the same class, it is safe and much more efficient to just clone the internal state arrays.
It's already exactly that for HashSets (although it doesn't check for exact class; it should).
hi @syskin345 i am a newbie to the open source code. I wanted to contribute but need your guidance as well
@syskin345 Can you please give one example of good copy-constructor for HashSet and one example of bad copy-constructor for HashMap?