head 또는 last를 정렬하고 사용하는 경우를 보고하고 max 또는 min으로 바꿀 것을 제안합니다.
head
last
max
min
예:
Seq("abc", "defg", "h").sorted.head Seq("abc", "defg", "h").sortBy(_.length).last
빠른 수정 적용 후:
Seq("abc", "defg", "h").min Seq("abc", "defg", "h").maxBy(_.length)