Populating Boolean variables


Link to this posting

Postby Ursego » 21 Feb 2013, 22:07

If it's possible, populate Boolean variables with results of Boolean expressions instead of direct assigning of true and false.

*** BAD code: ***

Code: Select all
if (rowCount > 1)
   multiRowsMode = true;
else
   multiRowsMode = false;

*** GOOD code: ***

Code: Select all
multiRowsMode = (rowCount > 1);
User avatar
Ursego
Site Admin
 
Posts: 143
Joined: 19 Feb 2013, 20:33



Ketones are a more high-octane fuel for your brain than glucose. Become a biohacker and upgrade yourself to version 2.0!



cron
Traffic Counter

eXTReMe Tracker