Menu

#61 Improve unneeded return keyword - Ternary & Conditions

open
nobody
None
5
2013-02-16
2010-11-09
No

CodeNarc: Improve unneeded return keyword - Ternary & Conditions
Should fail:
def x = {
if (it) return x else return y
}
def x = {
if (it) {return x} else {return y}
}
def x = {
it ? return x : return y
}
def x = {
it ?: return y
}

Discussion


Log in to post a comment.