Skip to content

Commit 0daba05

Browse files
author
extempore
committed
Some post-facto patch cleanups, no review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25311 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
1 parent aa3b646 commit 0daba05

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

src/library/scala/math/Ordered.scala

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package scala.math
1010

1111
/** A trait for data that have a single, natural ordering. See
1212
* [[scala.math.Ordering]] before using this trait for
13-
* more information about whether to use use [[scala.math.Ordering]] instead.
13+
* more information about whether to use [[scala.math.Ordering]] instead.
1414
*
1515
* Classes that implement this trait can be sorted with
1616
* [[scala.utils.Sorting]] and can be compared with standard comparison operators
@@ -20,8 +20,9 @@ package scala.math
2020
* integers) while Ordering allows for multiple ordering implementations.
2121
* An Ordering instance will be implicitly created if necessary.
2222
*
23-
* [[scala.math.Ordering]] is an alternative to this trait that allows multiple orderings to be defined for the same type.
24-
*
23+
* [[scala.math.Ordering]] is an alternative to this trait that allows multiple orderings to be
24+
* defined for the same type.
25+
*
2526
* [[scala.math.PartiallyOrdered]] is an alternative to this trait for partially ordered data.
2627
*
2728
* For example, to create a simple class that implements Ordered and then sort it with [[scala.utils.Sorting]]:
@@ -34,23 +35,16 @@ package scala.math
3435
* val result = scala.utils.Sorting.quickSort(x)
3536
* }}}
3637
*
37-
* Some additional notes from the initial implementation:
38-
*
39-
* Note that since version 2006-07-24 this trait is no longer covariant in `A`.
40-
*
41-
* It is important that the `equals` method for an instance of `Ordered[A]`
42-
* be consistent with the compare method. However, due to limitations
43-
* inherent in the type erasure semantics, there is no reasonable way to
44-
* provide a default implementation of equality for instances of `Ordered[A]`.
45-
* Therefore, if you need to be able to use equality on an instance of
46-
* `Ordered[A]` you must provide it yourself either when inheriting or
47-
* instantiating.
38+
* It is important that the `equals` method for an instance of `Ordered[A]` be consistent with the
39+
* compare method. However, due to limitations inherent in the type erasure semantics, there is no
40+
* reasonable way to provide a default implementation of equality for instances of `Ordered[A]`.
41+
* Therefore, if you need to be able to use equality on an instance of `Ordered[A]` you must
42+
* provide it yourself either when inheriting or instantiating.
4843
*
49-
* It is important that the `hashCode` method for an instance of `Ordered[A]`
50-
* be consistent with the `compare` method. However, it is not possible to
51-
* provide a sensible default implementation. Therefore, if you need to be
52-
* able compute the hash of an instance of `Ordered[A]` you must provide it
53-
* yourself either when inheriting or instantiating.
44+
* It is important that the `hashCode` method for an instance of `Ordered[A]` be consistent with
45+
* the `compare` method. However, it is not possible to provide a sensible default implementation.
46+
* Therefore, if you need to be able compute the hash of an instance of `Ordered[A]` you must
47+
* provide it yourself either when inheriting or instantiating.
5448
*
5549
* @see [[scala.math.Ordering]], [[scala.math.PartiallyOrdered]]
5650
* @author Martin Odersky

src/library/scala/util/matching/Regex.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,8 @@ object Regex {
413413
def unapply(m: Match): Some[String] = Some(m.matched)
414414
}
415415

416-
/** An extractor object that yields groups in the match. The main
417-
* advantage of using this is extractor instead of using the original
418-
* regex is that this avoids rematching the string.
419-
*
420-
* For example:
416+
/** An extractor object that yields the groups in the match. Using an extractor
417+
* rather than the original regex avoids recomputing the match.
421418
*
422419
* {{{
423420
* import scala.util.matching.Regex.Groups

0 commit comments

Comments
 (0)