Skip to content

Commit

Permalink
More explicit empty paren lists in method calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Feb 24, 2013
1 parent 6e450ed commit 41703df
Show file tree
Hide file tree
Showing 133 changed files with 552 additions and 550 deletions.
Expand Up @@ -262,7 +262,7 @@ abstract class InlineExceptionHandlers extends SubComponent {
if (analyzedMethod eq NoIMethod) {
analyzedMethod = bblock.method
tfa.init(bblock.method)
tfa.run
tfa.run()
log(" performed tfa on method: " + bblock.method)

for (block <- bblock.method.blocks.sortBy(_.label))
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/backend/opt/Inliners.scala
Expand Up @@ -232,7 +232,7 @@ abstract class Inliners extends SubComponent {

val hasRETURN = containsRETURN(incm.code.blocksList) || (incm.exh exists { eh => containsRETURN(eh.blocks) })
var a: analysis.MethodTFA = null
if(hasRETURN) { a = new analysis.MethodTFA(incm); a.run }
if(hasRETURN) { a = new analysis.MethodTFA(incm); a.run() }

if(forceable) { recentTFAs.put(incm.symbol, (hasRETURN, a)) }

Expand Down
Expand Up @@ -764,7 +764,7 @@ abstract class ICodeReader extends ClassfileParser {

// method.dump
tfa.init(method)
tfa.run
tfa.run()
for (bb <- linearizer.linearize(method)) {
var info = tfa.in(bb)
for (i <- bb.toList) {
Expand Down
10 changes: 5 additions & 5 deletions src/library/scala/Array.scala
Expand Up @@ -242,7 +242,7 @@ object Array extends FallbackArrayBuilding {
val b = newBuilder[T]
b.sizeHint(xss.map(_.size).sum)
for (xs <- xss) b ++= xs
b.result
b.result()
}

/** Returns an array that contains the results of some element computation a number
Expand All @@ -267,7 +267,7 @@ object Array extends FallbackArrayBuilding {
b += elem
i += 1
}
b.result
b.result()
}

/** Returns a two-dimensional array that contains the results of some element
Expand Down Expand Up @@ -331,7 +331,7 @@ object Array extends FallbackArrayBuilding {
b += f(i)
i += 1
}
b.result
b.result()
}

/** Returns a two-dimensional array containing values of a given function
Expand Down Expand Up @@ -406,7 +406,7 @@ object Array extends FallbackArrayBuilding {
b += i
i += step
}
b.result
b.result()
}

/** Returns an array containing repeated applications of a function to a start value.
Expand All @@ -431,7 +431,7 @@ object Array extends FallbackArrayBuilding {
b += acc
}
}
b.result
b.result()
}

/** Called in a pattern match like `{ case Array(x,y,z) => println('3 elements')}`.
Expand Down
4 changes: 2 additions & 2 deletions src/library/scala/Enumeration.scala
Expand Up @@ -95,7 +95,7 @@ abstract class Enumeration (initial: Int) extends Serializable {
protected var nextName: Iterator[String] = _

private def nextNameOrNull =
if (nextName != null && nextName.hasNext) nextName.next else null
if (nextName != null && nextName.hasNext) nextName.next() else null

/** The highest integer amongst those used to identify values in this
* enumeration. */
Expand Down Expand Up @@ -277,7 +277,7 @@ abstract class Enumeration (initial: Int) extends Serializable {
def newBuilder: mutable.Builder[Value, ValueSet] = new mutable.Builder[Value, ValueSet] {
private[this] val b = new mutable.BitSet
def += (x: Value) = { b += (x.id - bottomId); this }
def clear() = b.clear
def clear() = b.clear()
def result() = new ValueSet(b.toImmutable)
}
/** The implicit builder for value sets */
Expand Down
2 changes: 1 addition & 1 deletion src/library/scala/beans/ScalaBeanInfo.scala
Expand Up @@ -27,7 +27,7 @@ abstract class ScalaBeanInfo(clazz: java.lang.Class[_],
for (m <- clazz.getMethods if methods.exists(_ == m.getName))
yield new MethodDescriptor(m)

init
init()

override def getPropertyDescriptors() = pd
override def getMethodDescriptors() = md
Expand Down
2 changes: 1 addition & 1 deletion src/library/scala/collection/BitSetLike.scala
Expand Up @@ -109,7 +109,7 @@ trait BitSetLike[+This <: BitSetLike[This] with SortedSet[Int]] extends SortedSe
}
def next(): Int =
if (hasNext) { val r = current; current += 1; r }
else Iterator.empty.next
else Iterator.empty.next()
}

override def foreach[B](f: Int => B) {
Expand Down
4 changes: 2 additions & 2 deletions src/library/scala/collection/DefaultMap.scala
Expand Up @@ -30,14 +30,14 @@ trait DefaultMap[A, +B] extends Map[A, B] { self =>
val b = Map.newBuilder[A, B1]
b ++= this
b += ((kv._1, kv._2))
b.result
b.result()
}

/** A default implementation which creates a new immutable map.
*/
override def - (key: A): Map[A, B] = {
val b = newBuilder
b ++= this filter (key != _._1)
b.result
b.result()
}
}
4 changes: 2 additions & 2 deletions src/library/scala/collection/IndexedSeqLike.scala
Expand Up @@ -59,7 +59,7 @@ trait IndexedSeqLike[+A, +Repr] extends Any with SeqLike[A, Repr] {

def next(): A = {
if (index >= end)
Iterator.empty.next
Iterator.empty.next()

val x = self(index)
index += 1
Expand All @@ -68,7 +68,7 @@ trait IndexedSeqLike[+A, +Repr] extends Any with SeqLike[A, Repr] {

def head = {
if (index >= end)
Iterator.empty.next
Iterator.empty.next()

self(index)
}
Expand Down
10 changes: 5 additions & 5 deletions src/library/scala/collection/IndexedSeqOptimized.scala
Expand Up @@ -88,7 +88,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends Any with IndexedSeqLike[A, Repr] {
b += ((this(i), that(i).asInstanceOf[B]))
i += 1
}
b.result
b.result()
case _ =>
super.zip[A1, B, That](that)(bf)
}
Expand All @@ -103,7 +103,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends Any with IndexedSeqLike[A, Repr] {
b += ((this(i), i))
i += 1
}
b.result
b.result()
}

override /*IterableLike*/
Expand All @@ -119,7 +119,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends Any with IndexedSeqLike[A, Repr] {
b += self(i)
i += 1
}
b.result
b.result()
}

override /*IterableLike*/
Expand Down Expand Up @@ -220,7 +220,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends Any with IndexedSeqLike[A, Repr] {
i -= 1
b += this(i)
}
b.result
b.result()
}

override /*SeqLike*/
Expand All @@ -231,7 +231,7 @@ trait IndexedSeqOptimized[+A, +Repr] extends Any with IndexedSeqLike[A, Repr] {
if (0 < i) {
i -= 1
self(i)
} else Iterator.empty.next
} else Iterator.empty.next()
}

override /*SeqLike*/
Expand Down
48 changes: 24 additions & 24 deletions src/library/scala/collection/IterableLike.scala
Expand Up @@ -88,13 +88,13 @@ self =>
override /*TraversableLike*/ def toIterator: Iterator[A] =
iterator
override /*TraversableLike*/ def head: A =
iterator.next
iterator.next()

override /*TraversableLike*/ def slice(from: Int, until: Int): Repr = {
val lo = math.max(from, 0)
val elems = until - lo
val b = newBuilder
if (elems <= 0) b.result
if (elems <= 0) b.result()
else {
b.sizeHintBounded(elems, this)
var i = 0
Expand All @@ -103,14 +103,14 @@ self =>
b += it.next
i += 1
}
b.result
b.result()
}
}

override /*TraversableLike*/ def take(n: Int): Repr = {
val b = newBuilder

if (n <= 0) b.result
if (n <= 0) b.result()
else {
b.sizeHintBounded(n, this)
var i = 0
Expand All @@ -119,7 +119,7 @@ self =>
b += it.next
i += 1
}
b.result
b.result()
}
}

Expand All @@ -130,21 +130,21 @@ self =>
var i = 0
val it = iterator
while (i < n && it.hasNext) {
it.next
it.next()
i += 1
}
(b ++= it).result
(b ++= it).result()
}

override /*TraversableLike*/ def takeWhile(p: A => Boolean): Repr = {
val b = newBuilder
val it = iterator
while (it.hasNext) {
val x = it.next
if (!p(x)) return b.result
val x = it.next()
if (!p(x)) return b.result()
b += x
}
b.result
b.result()
}

/** Partitions elements in fixed size ${coll}s.
Expand All @@ -158,7 +158,7 @@ self =>
for (xs <- iterator grouped size) yield {
val b = newBuilder
b ++= xs
b.result
b.result()
}

/** Groups elements in fixed size blocks by passing a "sliding window"
Expand Down Expand Up @@ -187,7 +187,7 @@ self =>
for (xs <- iterator.sliding(size, step)) yield {
val b = newBuilder
b ++= xs
b.result
b.result()
}

/** Selects last ''n'' elements.
Expand All @@ -203,11 +203,11 @@ self =>
val lead = this.iterator drop n
var go = false
for (x <- this.seq) {
if (lead.hasNext) lead.next
if (lead.hasNext) lead.next()
else go = true
if (go) b += x
}
b.result
b.result()
}

/** Selects all elements except last ''n'' ones.
Expand All @@ -224,17 +224,17 @@ self =>
val it = iterator
while (lead.hasNext) {
b += it.next
lead.next
lead.next()
}
b.result
b.result()
}

override /*TraversableLike*/ def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
var i = start
val end = (start + len) min xs.length
val it = iterator
while (i < end && it.hasNext) {
xs(i) = it.next
xs(i) = it.next()
i += 1
}
}
Expand All @@ -244,21 +244,21 @@ self =>
val these = this.iterator
val those = that.iterator
while (these.hasNext && those.hasNext)
b += ((these.next, those.next))
b.result
b += ((these.next(), those.next()))
b.result()
}

def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CanBuildFrom[Repr, (A1, B), That]): That = {
val b = bf(repr)
val these = this.iterator
val those = that.iterator
while (these.hasNext && those.hasNext)
b += ((these.next, those.next))
b += ((these.next(), those.next()))
while (these.hasNext)
b += ((these.next, thatElem))
b += ((these.next(), thatElem))
while (those.hasNext)
b += ((thisElem, those.next))
b.result
b += ((thisElem, those.next()))
b.result()
}

def zipWithIndex[A1 >: A, That](implicit bf: CanBuildFrom[Repr, (A1, Int), That]): That = {
Expand All @@ -268,7 +268,7 @@ self =>
b += ((x, i))
i +=1
}
b.result
b.result()
}

def sameElements[B >: A](that: GenIterable[B]): Boolean = {
Expand Down

0 comments on commit 41703df

Please sign in to comment.