From 44856c81aff5c169f65038061ccb8be78f0c5b4e Mon Sep 17 00:00:00 2001 From: Ryan <73148864+Ryan-000@users.noreply.github.com> Date: Wed, 10 Sep 2025 19:01:35 -0400 Subject: [PATCH] Optimize Animation::_track_update_hash Co-Authored-By: Silc Lizard (Tokage) Renew Co-Authored-By: Luo Zhihao Co-Authored-By: Lukas Tenbrink --- scene/resources/animation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index f86577f2370..f6d5be2bac6 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -1062,9 +1062,9 @@ Animation::TrackType Animation::get_cache_type(TrackType p_type) { } void Animation::_track_update_hash(int p_track) { - NodePath track_path = tracks[p_track]->path; - TrackType track_cache_type = get_cache_type(tracks[p_track]->type); - tracks[p_track]->thash = StringName(String(track_path.get_concatenated_names()) + String(track_path.get_concatenated_subnames()) + itos(track_cache_type)).hash(); + const NodePath &track_path = tracks[p_track]->path; + const TrackType track_cache_type = get_cache_type(tracks[p_track]->type); + tracks[p_track]->thash = HashMapHasherDefault::hash(Pair(track_path, track_cache_type)); } Animation::TypeHash Animation::track_get_type_hash(int p_track) const {