PDA

View Full Version : Order of declaring variables and performance



babu198649
11th November 2009, 08:35
Hi,
I have found the below code in qpoint.h file


#if defined(Q_OS_MAC)
int yp;
int xp;
#else
int xp;
int yp;
#endif

Does changing the order of declaration variabes affect the performance.

yogeshgokul
11th November 2009, 09:12
Does changing the order of declaration variabes affect the performance.
Never... ;)

babu198649
11th November 2009, 14:59
then why does the qpoint.h file changes the order of definations of variables differently on different platforms.

wysota
12th November 2009, 03:20
To make the code look smarter? ;)

Actually the order of variables can influence some things (performance included, probably), but not in this case.