Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 250136a

Browse files
authored
Merge pull request #6906 from Prithvirajbilla/10980
Adds missing method .compare in SortedOps
2 parents 795808c + d4c5aa0 commit 250136a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/library/scala/collection/SortedOps.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ trait SortedOps[A, +C] {
1212
/** Returns the last key of the collection. */
1313
def lastKey: A
1414

15+
/** Comparison function that orders keys. */
16+
@deprecated("Use ordering.compare instead", "2.13.0")
17+
@deprecatedOverriding("Use ordering.compare instead", "2.13.0")
18+
@inline def compare(k0: A, k1: A): Int = ordering.compare(k0, k1)
19+
1520
/** Creates a ranged projection of this collection. Any mutations in the
1621
* ranged projection will update this collection and vice versa.
1722
*

0 commit comments

Comments
 (0)