替换 if else 语句,两种情况下都会 return 到单个 return 表达式,而不更改语义