Conversation
Can you elaborate on that ? I don't understand the change of iteration order |
d = CleverDicts.CleverDict{Int,Float64}(hash, inverse_hash, 3)
d[4] = 0.25
d[2] = 1.5used to iterate Now preallocating with |
|
Ok I see, the |
|
I'll wait for @joaquimg to take a look before merging. |
|
I am ok with removing the sizehint on init. People can do that in two steps. |
| function CleverDict{K,V}( | ||
| hash::F, | ||
| inverse_hash::I, | ||
| n::Integer = 0, |
There was a problem hiding this comment.
@joaquimg says we should just remove this argument.
|
I'll remove the input argument in a separate PR. |
Closes #1326
This simplifies things by removing
.setfield. It also fixes an inference issue inkeys.The downside is that it breaks the iteration order for items in a
CleverDictinitialized with storage but not yet filled.To be honest, I don't really understand the need for pre-initializing the CleverDict. I've left the option, but it now calls
size hintinstead of pre-allocating the space.