diff options
author | Daniel Dietrich <daniel.dietrich@gmx.net> | 2015-06-05 23:36:10 +0200 |
---|---|---|
committer | Daniel Dietrich <daniel.dietrich@gmx.net> | 2015-06-05 23:36:10 +0200 |
commit | c834fc2634d621599602fad3d9036df382975f9b (patch) | |
tree | 13a740e1a526c0ebebbb647378faf2d8c753e99b | |
parent | 3667df14ff8c5a5866d3dee0c9857ef038e05d72 (diff) | |
download | scala-c834fc2634d621599602fad3d9036df382975f9b.tar.gz scala-c834fc2634d621599602fad3d9036df382975f9b.tar.bz2 scala-c834fc2634d621599602fad3d9036df382975f9b.zip |
Better names for length values
-rw-r--r-- | src/library/scala/collection/immutable/Queue.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala index e40ebdbe71..53af3ce158 100644 --- a/src/library/scala/collection/immutable/Queue.scala +++ b/src/library/scala/collection/immutable/Queue.scala @@ -56,12 +56,12 @@ class Queue[+A] protected(protected val in: List[A], protected val out: List[A]) * @throws java.util.NoSuchElementException if the queue is too short. */ override def apply(n: Int): A = { - val len = out.length - if (n < len) out.apply(n) + val olen = out.length + if (n < olen) out.apply(n) else { - val m = n - len - val l = in.length - if (m < l) in.apply(l - m - 1) + val m = n - olen + val ilen = in.length + if (m < ilen) in.apply(ilen - m - 1) else throw new NoSuchElementException("index out of range") } } |