File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333#include " core/variant/variant.h"
3434
3535void NodePath::_update_hash_cache () const {
36- uint32_t h = data->absolute ? 1 : 0 ;
37- int pc = data->path .size ();
38- const StringName *sn = data->path .ptr ();
39- for (int i = 0 ; i < pc; i++) {
40- h = h ^ sn[i].hash ();
41- }
42- int spc = data->subpath .size ();
43- const StringName *ssn = data->subpath .ptr ();
44- for (int i = 0 ; i < spc; i++) {
45- h = h ^ ssn[i].hash ();
46- }
47-
36+ StringName path = get_concatenated_names ();
37+ StringName subpath = get_concatenated_subnames ();
38+ uint32_t hash = HashMapHasherDefault::hash (Pair<const StringName &, const StringName &>(path, subpath));
39+ data->hash_cache = is_absolute () ? hash : ~hash;
4840 data->hash_cache_valid = true ;
49- data->hash_cache = h;
5041}
5142
5243void NodePath::prepend_period () {
You can’t perform that action at this time.
0 commit comments