"Constants" at least thats what i think they all are

Dois

New Member
Reaction score
1

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Vexorian's Optimizer fills in constants for you, the things you should replace are usually BJ functions, not constants.
 

Sooda

Diversity enchants
Reaction score
318
> ConvertUnitType(2)

I assume these (UNIT_TYPE_STRUCTURE for example) variables are set when map loads. Instead calling each time ConvertUnitType(x) you use global variable what is constant because once set it dosn' t change.
 

Joker(Div)

Always Here..
Reaction score
86
I'm pretty sure it doesn't matter. If you optimize your map with Vex's optimizer, it inlines all constants
 

SFilip

Gone but not forgotten
Reaction score
634
Using UNIT_TYPE_STRUCTURE is faster - ConvertUnitType(2) means you do a function call every time the game runs that line. And a function call is generally slower than using a variable.
Constants exist for a reason. By all means, use them.
 

Dois

New Member
Reaction score
1
oh.. so it would be better to do...

JASS:
local unit U = GetTriggerUnit()


at the start of the trigger and use "U" all the way instead of using GetTriggerUnit() for all the functions thats gonna "take" the unit?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top