I sense that the Scala community has a little big obsession with writing \"concise\", \"cool\", \"scala idiomatic\", \"one-liner\" -if possible- code. This
What about this?
def removeMax(xs: List[Int]) = { val buf = xs.toBuffer buf -= (buf.max) }
A bit more ugly, but faster:
def removeMax(xs: List[Int]) = { var max = xs.head for ( x <- xs.tail ) yield { if (x > max) { val result = max; max = x; result} else x } }