Copy link to clipboard
Copied
Is any optimization done with operations involving constants, particularly converting operations with const to literal values.
I know the C++ compiler will effectively (not literally) convert this code:
const int VALUE_1 = 5;
const int VALUE_2 = 2;
int value3 = VALUE_1 + VALUE_2;
into something like this:
int value3 = 7;
This saves the program from adding 5 and 2 together while the program is running. I know that AS3 with flash is an interpreted language, so I'm not sure if the same can be done with it.
Does any optimization take place with const when declared on the method or class levels?
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now