Skip to content

Commit 44856c8

Browse files
Ryan-000TokageItLabbeicauseIvorforce
committed
Optimize Animation::_track_update_hash
Co-Authored-By: Silc Lizard (Tokage) Renew <[email protected]> Co-Authored-By: Luo Zhihao <[email protected]> Co-Authored-By: Lukas Tenbrink <[email protected]>
1 parent 3defc85 commit 44856c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scene/resources/animation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,9 @@ Animation::TrackType Animation::get_cache_type(TrackType p_type) {
10621062
}
10631063

10641064
void Animation::_track_update_hash(int p_track) {
1065-
NodePath track_path = tracks[p_track]->path;
1066-
TrackType track_cache_type = get_cache_type(tracks[p_track]->type);
1067-
tracks[p_track]->thash = StringName(String(track_path.get_concatenated_names()) + String(track_path.get_concatenated_subnames()) + itos(track_cache_type)).hash();
1065+
const NodePath &track_path = tracks[p_track]->path;
1066+
const TrackType track_cache_type = get_cache_type(tracks[p_track]->type);
1067+
tracks[p_track]->thash = HashMapHasherDefault::hash(Pair<const NodePath &, TrackType>(track_path, track_cache_type));
10681068
}
10691069

10701070
Animation::TypeHash Animation::track_get_type_hash(int p_track) const {

0 commit comments

Comments
 (0)