optimization - In C, which is faster: if with returns, or else if with returns? -


Is it better if / else if, if if statement gives each block or is it better is the chain of ICs? To be specific, which is the fastest:

A:

  if (condition1) {code1; Return; } If (condition2) {code2; Return b; } // etc ...  

b:

  if (condition1) {code1; Return; } And if (condition2) {code2; Return b; } // etc ...  

It does not matter, and this is an unnecessary Attempt on micro-optimization.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -