Skip to content
Prev Previous commit
Next Next commit
IterableOnce: Documentation update in IterableOnce cmp -> ord
Some functions appear to be using an outdated name for the ordering function parameter (formerly cmp, now ord) in the documentation. Those are changed to the current name (ord).

Signed-off-by: Evgeny Vereshchagin <[email protected]>

Upstream: scala/scala@80589cc
  • Loading branch information
ev-ev authored and WojciechMazur committed Dec 21, 2025
commit bea3196854914e45b7a4541a3eca1159d57696ea
16 changes: 8 additions & 8 deletions library/src/scala/collection/IterableOnce.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1174,12 +1174,12 @@ transparent trait IterableOnceOps[+A, +CC[_], +C] extends Any { this: IterableOn
*
* $willNotTerminateInf
*
* @param cmp An ordering to be used for comparing elements.
* @param ord An ordering to be used for comparing elements.
* @tparam B The result type of the function `f`.
* @param f The measuring function.
* @throws UnsupportedOperationException if this $coll is empty.
* @return the first element of this $coll with the largest value measured by function `f`
* with respect to the ordering `cmp`.
* with respect to the ordering `ord`.
*/
def maxBy[B](f: A -> B)(implicit ord: Ordering[B]): A =
knownSize match {
Expand Down Expand Up @@ -1214,11 +1214,11 @@ transparent trait IterableOnceOps[+A, +CC[_], +C] extends Any { this: IterableOn
*
* $willNotTerminateInf
*
* @param cmp An ordering to be used for comparing elements.
* @param ord An ordering to be used for comparing elements.
* @tparam B The result type of the function `f`.
* @param f The measuring function.
* @return an option value containing the first element of this $coll with the
* largest value measured by function `f` with respect to the ordering `cmp`.
* largest value measured by function `f` with respect to the ordering `ord`.
*/
def maxByOption[B](f: A -> B)(implicit ord: Ordering[B]): Option[A] =
knownSize match {
Expand All @@ -1230,12 +1230,12 @@ transparent trait IterableOnceOps[+A, +CC[_], +C] extends Any { this: IterableOn
*
* $willNotTerminateInf
*
* @param cmp An ordering to be used for comparing elements.
* @param ord An ordering to be used for comparing elements.
* @tparam B The result type of the function `f`.
* @param f The measuring function.
* @throws UnsupportedOperationException if this $coll is empty.
* @return the first element of this $coll with the smallest value measured by function `f`
* with respect to the ordering `cmp`.
* with respect to the ordering `ord`.
*/
def minBy[B](f: A -> B)(implicit ord: Ordering[B]): A =
knownSize match {
Expand All @@ -1247,12 +1247,12 @@ transparent trait IterableOnceOps[+A, +CC[_], +C] extends Any { this: IterableOn
*
* $willNotTerminateInf
*
* @param cmp An ordering to be used for comparing elements.
* @param ord An ordering to be used for comparing elements.
* @tparam B The result type of the function `f`.
* @param f The measuring function.
* @return an option value containing the first element of this $coll
* with the smallest value measured by function `f`
* with respect to the ordering `cmp`.
* with respect to the ordering `ord`.
*/
def minByOption[B](f: A -> B)(implicit ord: Ordering[B]): Option[A] =
knownSize match {
Expand Down