Skip to content

Commit

Permalink
Fix miss in chinese translation
Browse files Browse the repository at this point in the history
  • Loading branch information
lispking committed Mar 1, 2015
1 parent f0f6cd1 commit e43d9de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion effectivescala-cn.mo
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ elaborate..

并不是说命令式结构没有价值。在很多例子中它们很适合于提前终止计算而非对每个可能终止的点存在一个条件分支:的确在上面的fixDown函数,如果我们已经在堆的结尾,一个return用于提前终止。

Returns可以用于切断分支和建立不变量(establish invariants)。这减少了嵌套,并且容易推断后续的代码的正确性,从而帮助了读者。这尤其适用于卫语句(guard clauses):
Returns可以用于切断分支和建立不变量(establish invariants)。这减少了嵌套,并且容易推断后续的代码的正确性,从而帮助了读者。这尤其适用于守卫语句(guard clauses):

def compare(a: AnyRef, b: AnyRef): Int = {
if (a eq b)
Expand Down

0 comments on commit e43d9de

Please sign in to comment.