Closed antoine-wdg-rmz closed 6 years ago
perfect! Good idea about implementing IMap
, the only thing is that HashMap
may have some extra methods compared to IMap
, so that could be problematic. I agree things are a little poor in that area.
The other thing is that maybe there's a way that we don't need two classes to begin with, I wrote this comment in the source:
// we need to override the empty hashmap // because i don't know how to get the hash & keyset // functions for the keys without a key value to get // the functions from
Well, for linked list we make the dichotomy (empty/not empty) public, and even take advantage of it, so who knows, maybe it's even not a bad thing.
I'll make a quick bugfix release since that's a bit of a bigger issue.
0.7.9 is on npm with your fix! Thank you again!
(and add unit tests on
containsKey
)IMO
EmptyHashMap
should not inheritHashMap
and simply implementIMap
, this would catch errors like that.