Boolean types

前端 未结 10 2023
时光说笑
时光说笑 2021-01-22 11:54

During code review I discovered many places of our C# code that looks like this:

if(IsValid()) {
     return true;
}
else {
     return false;
}
<
10条回答
  •  囚心锁ツ
    2021-01-22 12:33

    return IsValid(); is the way to go. less code, more concise - choice of champions

提交回复
热议问题