summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-06-08 12:18:04 +0000
committermichelou <michelou@epfl.ch>2007-06-08 12:18:04 +0000
commite182625e5108e7f78751200317c82702d95cfbd9 (patch)
treead1c8a299c2a1b9332307a7d587ff47353a41b5d
parent540c308ca6d7ef2370bfaa8d1b0870003a2c1037 (diff)
downloadscala-e182625e5108e7f78751200317c82702d95cfbd9.tar.gz
scala-e182625e5108e7f78751200317c82702d95cfbd9.tar.bz2
scala-e182625e5108e7f78751200317c82702d95cfbd9.zip
minor changes
-rw-r--r--src/library/scala/runtime/RichInt.scala8
-rw-r--r--src/library/scala/runtime/RichShort.scala6
-rw-r--r--src/library/scala/runtime/RichString.scala6
3 files changed, 11 insertions, 9 deletions
diff --git a/src/library/scala/runtime/RichInt.scala b/src/library/scala/runtime/RichInt.scala
index 31e3778a96..f2fd48810a 100644
--- a/src/library/scala/runtime/RichInt.scala
+++ b/src/library/scala/runtime/RichInt.scala
@@ -16,14 +16,16 @@ final class RichInt(start: Int) extends Proxy with Ordered[Int] {
def self: Any = start
// Ordered[Int]
- def compare (that: Int): Int = if (start < that) -1 else if (start > that) 1 else 0
+ def compare(that: Int): Int = if (start < that) -1 else if (start > that) 1 else 0
/** See <code>Iterator.range</code>. */
def until(end: Int): Range = Iterator.range(start, end)
+
/** See <code>Iterator.range</code>. */
- def until(end : Int, step : Int) : Range = Iterator.range(start, end, step)
+ def until(end: Int, step: Int): Range = Iterator.range(start, end, step)
+
/** like <code>until</code>, but includes the last index */
- def to(end : Int) = until(end + 1)
+ def to(end: Int) = until(end + 1)
def min(that: Int): Int = if (start < that) start else that
def max(that: Int): Int = if (start > that) start else that
diff --git a/src/library/scala/runtime/RichShort.scala b/src/library/scala/runtime/RichShort.scala
index 4615dec610..c9e3a120f7 100644
--- a/src/library/scala/runtime/RichShort.scala
+++ b/src/library/scala/runtime/RichShort.scala
@@ -1,7 +1,7 @@
/* __ *\
** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2002-2006, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** / __/ __// _ | / / / _ | (c) 2002-2007, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
@@ -18,6 +18,6 @@ final class RichShort(x: Short) extends Proxy with Ordered[Short] {
def self: Any = x
// Ordered[Short].compare
- def compare (y: Short): Int = if (x < y) -1 else if (x > y) 1 else 0
+ def compare(y: Short): Int = if (x < y) -1 else if (x > y) 1 else 0
}
diff --git a/src/library/scala/runtime/RichString.scala b/src/library/scala/runtime/RichString.scala
index 17acf97ff1..83751dab5a 100644
--- a/src/library/scala/runtime/RichString.scala
+++ b/src/library/scala/runtime/RichString.scala
@@ -83,8 +83,8 @@ final class RichString(val self: String) extends Proxy with Seq[Char] with Order
def next(): String = {
if (index >= len) throw new NoSuchElementException("next on empty iterator")
val start = index
- while (index < len && !isLineBreak(apply(index))) index = index + 1
- index = index + 1
+ while (index < len && !isLineBreak(apply(index))) index += 1
+ index += 1
self.substring(start, index min len)
}
}
@@ -116,7 +116,7 @@ final class RichString(val self: String) extends Proxy with Seq[Char] with Order
for (line <- linesWithSeparators) {
val len = line.length
var index = 0;
- while (index < len && line.charAt(index) <= ' ') index = index + 1
+ while (index < len && line.charAt(index) <= ' ') index += 1
buf append
(if (index < len && line.charAt(index) == marginChar) line.substring(index + 1) else line)
}