Thank you for your reply.
I'm really interested in speed, and very little in readability and ease of maintenance.
You say that an ok compiler should optimise the second (or more, i just put two in the example) comparison. But will that optimisation reach the speed obtained by factorizing the...
Thank you for your answer.
The code doesn't affect n's value, no.
In f2, the test if(n == 3) is only done once, but some code is duplicated (blocks 01, 02 and 03) as a result. If I understand you correctly, f2 will be faster ?
Michael.
Hello,
I think you have a typo at the beginning of zserial.h. It should be #ifndef instead of #ifdef.
I can't help you with the other error, sorry.
Michael
Hello,
Let's say you have a function like this one :
void f( int n ) {
... some code 01 ...
if( n == 3 ) {
... some code Test1a ...
}
else {
... some code Test1b ...
}
... some code 02 ...
if( n == 3 ) {
... some code Test2a ...
}
else {
... some code...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.