There are some extremely fast conditional expressions true, num = 123, and constants are all generally the same speed. however sometimes it make more sense to write it one way, even if doing it another way would actually be faster. for example this bit of code inside gmlc:
if (env.isKeyword("enum"))
&& (currentToken.type == __GMLC_TokenType_Keyword)
&& (currentToken.value == "enum")
it would actually be faster to parse it like so:
if (currentToken.type == __GMLC_TokenType_Keyword)
&& (currentToken.value == "enum")
&& (env.isKeyword("enum"))
where we prioritize the constant number compare, then the string compare, then the struct look up through 2-3 function calls of a constructor.
There are some extremely fast conditional expressions
true,num = 123, and constants are all generally the same speed. however sometimes it make more sense to write it one way, even if doing it another way would actually be faster. for example this bit of code inside gmlc:it would actually be faster to parse it like so:
where we prioritize the constant number compare, then the string compare, then the struct look up through 2-3 function calls of a constructor.