You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I don't think the behavior you're seeing is related at all to priority-map - the update-in turns into an assoc on the priority map with the effect that the value at key "some key" becomes (merge old-value m).
What you are witnessing is Clojure choosing map implementations, for performance reasons, based on size. PersistentHashMap and PersisentArrayMap are types you're seeing in the priority-map, not of it.
Yes I'm aware that Clojure is choosing map implementations... though it took me a while to figure out what was actually happening 😄
The reason I've opened an "issue" is that if I where to update-in a hash-map, array-map or sorted-map I wouldn't bump into the error because they don't sort by value.
I think I have solved my problem by using priority-map-by where I provide my own sorting function which doesn't care about the map type inserted as a value into the priority-map.
I've been using a priority-map inside an atom and I'm updating like the following:
The problem is that depending on the amount of keys in
m
(it seems), the merge function will either returnPersistentHashMap
or aPersistentArrayMap
Is there anyway that I can make the priority-map "not care" or force it to be one or the other?
The text was updated successfully, but these errors were encountered: