But it would probably be more readable just to do

    val s = if (s1 > s2) (s2, s1) else (s1, s2)