-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make AnimationNodeBlendTree
use RBMap
instead HashMap
#79595
Conversation
AnimationNodeBlendTree
use RBMap
insteads HashMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed deterministic sort and using an ordered map off Github.
Can't you just use |
!! You are right, I didn't care that RBMap has a Comparator. It is working perfectly. So this is now a one-line change. Thanks! |
348e5c7
to
29d63f4
Compare
That could probably have been suggested in the original PR going forward |
29d63f4
to
a3cdacd
Compare
Thanks! |
AnimationNodeBlendTree
use RBMap
insteads HashMap
AnimationNodeBlendTree
use RBMap
instead HashMap
Fixes #42788. Alternative PR of #79530.
node_connections
is stored in ordered array, but the order of the array depends on theHashMap nodes
, so every time the hash is changed, the.tres
is changed.This PR ensures uniqueness in the order of nodes by using an
RBMap
for nodes.However, there seems to be a problem with inconsistent insertion locations when
StringName
is used as the key forRBMap
(see also #79596). Therefore,RBMap<String, Node>
should be used instead ofRBMap<StringName, Node>
.Although not related to this PR, if you are using
RBMap<StringName, V>
in other classes, you may need to replace it withHashMap<StringName, V>
orRBMap<String, V>
.