#struct as ds_map key

1 messages · Page 1 of 1 (latest)

thorn bone
#

If i use a struct as a key for a ds map, what is being hashed ? is it the string representation?

quartz briar
#

a quick test seems to say yes

var _a = { a: 1 }

show_debug_message(_a) // => { a : 1 }
show_debug_message(variable_get_hash("a")) // => 100011
show_debug_message(variable_get_hash("{ a : 1 }")) // => 100253
show_debug_message(variable_get_hash(_a)) // => 100253
copper oracle
#

They're not the same

copper oracle
#

So I'm fairly certain it's some hash representation of the memory address to the struct

thorn bone