S
stevecanfield
I'd like to know if code like:
long id = obj1.getId();
obj2.someFn(id);
compiles down to:
obj2.someFn(obj1.getId());
I'm thinking it should because it's such an obvious optimization. But
then I'm thinking it can't because I can step through this code with a
debugger and see each statement get executed.
How can I answer this definitively? Is it a matter of looking at the
bytes of the compiled code?
-sc
long id = obj1.getId();
obj2.someFn(id);
compiles down to:
obj2.someFn(obj1.getId());
I'm thinking it should because it's such an obvious optimization. But
then I'm thinking it can't because I can step through this code with a
debugger and see each statement get executed.
How can I answer this definitively? Is it a matter of looking at the
bytes of the compiled code?
-sc