Is it bad to have multiple return statements?
Posted
by scot
on Stack Overflow
See other posts from Stack Overflow
or by scot
Published on 2010-05-30T15:14:19Z
Indexed on
2010/05/30
15:22 UTC
Read the original article
Hit count: 294
Hi,
I have a code somethg like below:
int method(string a ,int b , int c){
if(cond1)
return -1;
if(cond2 || cond3)
return 3;
if(cond1 && cond2)
return 0;
else
return -999;
}
Does it perform badly when compared to having multiple if else
and have single return?
© Stack Overflow or respective owner