R
Roedy Green
I wonder if anyone has ever looked at the byte code and/or the hotspot
code generated by code like this:
final int count = lines * 3 + ( b1 ? 2 : 0 ) + ( b2 ? 2 : 0 ) ;
vs:
int count = lines *3;
if ( b1 ) count += 2;
if ( b2 ) count += 2;
I wondered how clever it is. This is just curiosity. This is not
critical code.
Which style do you prefer?
--
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.
code generated by code like this:
final int count = lines * 3 + ( b1 ? 2 : 0 ) + ( b2 ? 2 : 0 ) ;
vs:
int count = lines *3;
if ( b1 ) count += 2;
if ( b2 ) count += 2;
I wondered how clever it is. This is just curiosity. This is not
critical code.
Which style do you prefer?
--
Roedy Green Canadian Mind Products
http://mindprod.com
It should not be considered an error when the user starts something
already started or stops something already stopped. This applies
to browsers, services, editors... It is inexcusable to
punish the user by requiring some elaborate sequence to atone,
e.g. open the task editor, find and kill some processes.