Welcome to MSDN Blogs Sign in | Join | Help

January 2008 - Posts

Remove Data-dependencies

Are you planning to remove data-dependencies in your logic? You might find the below useful. Statement Block Constant Time Equivalent x++; if(x >= MAX_SIZE) x = 0; x = ( x + 1 ) % MAX_SIZE; x--; if(x < 0) x = MAX_SIZE - 1; x = (x + MAX_SIZE – 1)
 
Page view tracker