Azenris
Member
does gml_release_mode removed 'undefined' or slow it down in release?
Basically I want to know whether I can
vs
Isn't the second one doing two map lookups everytime? I tried to search gml_release_mode
I saw at the bottom of this thread
"Checking for == undefined is pretty fast so long as you mind whether you intend to use gml_release_mode or not."
https://forum.yoyogames.com/index.php?threads/check-undefined-best-practice.53371/#post-325459
But did he mean its unuseable in release mode, or its slower, faster?
The GMS documentation says most error checking is removed, but I was unsure what that meant for maps and whether undefined is still a thing.
OR should I just go with the second code block and 2 map lookups each time?
Basically I want to know whether I can
Code:
var _temp = _map[? "moo" ];
if (_temp != undefined)
{
// do stuff with _temp
}
Code:
if ( ds_map_exists( _map, "moo" ) )
{
var _temp = _map[? "moo" ];
// do stuff with _temp
}
I saw at the bottom of this thread
"Checking for == undefined is pretty fast so long as you mind whether you intend to use gml_release_mode or not."
https://forum.yoyogames.com/index.php?threads/check-undefined-best-practice.53371/#post-325459
But did he mean its unuseable in release mode, or its slower, faster?
The GMS documentation says most error checking is removed, but I was unsure what that meant for maps and whether undefined is still a thing.
OR should I just go with the second code block and 2 map lookups each time?