我有代码:
if(conditional)
{
var r1 = dosomething();
//do more here
if(r1 > something)
{
var r2 = dosomething();
//do something
if(r2 > something)
{
....
//n if
}
}
}
我需要帮助这个代码更好。你能告诉我一些建议吗? 谢谢大家!
答案 0 :(得分:0)
i = 0;
while (rN > somethingArray[i]){ //if your 'something' is changing in every if use array otherwise simple variable like (rN > something) will work
rN = dosomething();
i++;
}