@@ -735,22 +735,23 @@ trait SeqOps[+A, +CC[_], +C] extends Any
735
735
}
736
736
737
737
/** Sorts this $coll according to a comparison function.
738
- * $willNotTerminateInf
739
- * $willForceEvaluation
740
- *
741
- * The sort is stable. That is, elements that are equal (as determined by
742
- * `lt`) appear in the same order in the sorted sequence as in the original.
743
- *
744
- * @param lt the comparison function which tests whether
745
- * its first argument precedes its second argument in
746
- * the desired ordering.
747
- * @return a $coll consisting of the elements of this $coll
748
- * sorted according to the comparison function `lt`.
749
- * @example {{{
750
- * List("Steve", "Tom", "John", "Bob").sortWith(_.compareTo(_) < 0) =
751
- * List("Bob", "John", "Steve", "Tom")
752
- * }}}
753
- */
738
+ * $willNotTerminateInf
739
+ * $willForceEvaluation
740
+ *
741
+ * The sort is stable. That is, elements that are equal
742
+ * (`lt` returns false for both directions of comparison)
743
+ * appear in the same order in the sorted sequence as in the original.
744
+ *
745
+ * @param lt a predicate that is true if
746
+ * its first argument strictly precedes its second argument in
747
+ * the desired ordering.
748
+ * @return a $coll consisting of the elements of this $coll
749
+ * sorted according to the comparison function `lt`.
750
+ * @example {{{
751
+ * List("Steve", "Bobby", "Tom", "John", "Bob").sortWith((x, y) => x.take(3).compareTo(y.take(3)) < 0) =
752
+ * List("Bobby", "Bob", "John", "Steve", "Tom")
753
+ * }}}
754
+ */
754
755
def sortWith (lt : (A , A ) => Boolean ): C = sorted(Ordering .fromLessThan(lt))
755
756
756
757
/** Sorts this $coll according to the Ordering which results from transforming
0 commit comments