[mythtv] C++ style

steve at nexusuk.org steve at nexusuk.org
Wed Feb 11 13:25:00 EST 2004

On Wed, 11 Feb 2004, John P. Poet wrote:

> For example, he says to always use pre-decrement/increment instead of
> post-decrement/increment -- when possible.  The "pre" versions can be
> converted into more efficient assembly language code, than the "post"
> versions.  The only time you should use the "post" version, is when you
> really need the increment/decrement to happend after the *current* value of
> the variable has been used in the expression.

I would hope the optimizer on the compiler would optimize correctly, 
afterall, it's not hard for the optimizer to spot that you're not 
assigning the value to anything (in which case it doesn't matter if you do 
post or pre, so the optimizer can pick the fastest).


 - Steve                                             http://www.nexusuk.org/

     Servatis a periculum, servatis a maleficum - Whisper, Evanescence

More information about the mythtv-dev mailing list