scalagen icon indicating copy to clipboard operation
scalagen copied to clipboard

Simplify if/else patterns

Open timowest opened this issue 12 years ago • 0 comments

turn

if (a == a1) return b1
else if (a == a2) return b2
else return x

into

a match {
  case a1 => b1
  case a2 => b2
  case _ => x
}

timowest avatar Jan 22 '12 22:01 timowest