How to return value if I don't need hit2 block.
Does this make sense or not? I think multi should not be used return, but I cannot replace it with break. there is no closed loop from which one can break or continue.
public EnResult MyFun()
{
bool bRet = default;
if (true)
{
return bRet = true_1;
}
else
{
}
if (true)
{
return bRet = true_2;
}
else
{
}
return bRet;
}
public enum EnResult
{
true_1,
true_2,
false_1,
false_2,
default,
}
source
share