Boolean types

前端 未结 10 2018
时光说笑
时光说笑 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:30

    I would also just say "return IsValid();" I think you're 100% correct in doing so

提交回复
热议问题