Difference between revisions of "Script Comparison Tests"
→'If' vs. 'Set'
imported>Haama (Category link) |
imported>Haama |
||
Line 25: | Line 25: | ||
end</pre> | end</pre> | ||
Results: Mixed bag - This | |||
<pre>begin GameMode | |||
if fQuestDelayTime | |||
set fQuestDelayTime to .01 | |||
endif | |||
end</pre> | |||
is faster than | |||
<pre>begin GameMode | |||
set fQuestDelayTime to .01 | |||
end</pre> | |||
but this | |||
<pre>begin GameMode | |||
if (fQuestDelayTime == 0) | |||
set fQuestDelayTime to .01 | |||
endif | |||
end</pre> | |||
is slower. So, if your 'if' test doesn't have any operators it's faster to test first, otherwise just set the variable. | |||
==GetParentCell vs. GetInSameCell== | ==GetParentCell vs. GetInSameCell== |