3 ms·
I agree with you but I do see his perspective. "Hashmaps make no guarantee about iteration order" does not imply the implementation is going to do _EXTRA WORK_
by pests 2y ago
I agree with you but I do see his perspective.
"Hashmaps make no guarantee about iteration order" does not imply the implementation is going to do _EXTRA WORK_ to make that true. It being ordered, or providing a guarantee of some order, is still within spec of the hashmap concept.
To expend extra cycles to force no order, when any order is fine (esp if it falls out of the data structure), is extra work. Its an extra constraint, one a hashmap does not require.
I wonder how much energy we have collectively spent sorting lists for no reason.