Permalink
Browse files

Remove redundant explicit returns.

  • Loading branch information...
1 parent bc99770 commit 256e46824636881f067ea0d312b5cbcdffbcf233 @retronym retronym committed Feb 24, 2013
@@ -155,7 +155,7 @@ trait GenTypes {
*/
private def reifySemiConcreteTypeMember(tpe: Type): Tree = tpe match {
case tpe @ TypeRef(pre @ SingleType(prepre, presym), sym, args) if sym.isAbstractType && !sym.isExistential =>
- return mirrorFactoryCall(nme.TypeRef, reify(pre), mirrorBuildCall(nme.selectType, reify(sym.owner), reify(sym.name.toString)), reify(args))
+ mirrorFactoryCall(nme.TypeRef, reify(pre), mirrorBuildCall(nme.selectType, reify(sym.owner), reify(sym.name.toString)), reify(args))
}
/** Reify an annotated type, i.e. the one that makes us deal with AnnotationInfos */
@@ -78,7 +78,7 @@ class Scaladoc extends ScalaMatchingTask {
val values = List("yes", "no", "on", "off")
def getBooleanValue(value: String, flagName: String): Boolean =
if (Flag.isPermissible(value))
- return ("yes".equals(value) || "on".equals(value))
+ ("yes".equals(value) || "on".equals(value))
else
buildError("Unknown " + flagName + " flag '" + value + "'")
}
@@ -230,9 +230,9 @@ trait Primitives { self: ICodes =>
/** Returns a string representation of this operation. */
override def toString(): String = this match {
- case AND => return "AND"
- case OR => return "OR"
- case XOR => return "XOR"
+ case AND => "AND"
+ case OR => "OR"
+ case XOR => "XOR"
case _ => throw new RuntimeException("LogicalOp unknown case")
}
}
@@ -52,7 +52,7 @@ class AbstractFileClassLoader(val root: AbstractFile, parent: ClassLoader)
return null
}
- return file
+ file
}
// parent delegation in JCL uses getResource; so either add parent.getResAsStream
@@ -481,14 +481,14 @@ abstract class ExplicitOuter extends InfoTransform
// at least don't crash... this duplicates maybeOmittable from constructors
(acc.owner.isEffectivelyFinal && !acc.isOverridingSymbol)) {
unit.uncheckedWarning(tree.pos, "The outer reference in this type test cannot be checked at run time.")
- return transform(TRUE) // urgh... drop condition if there's no accessor (or if it may disappear after constructors)
+ transform(TRUE) // urgh... drop condition if there's no accessor (or if it may disappear after constructors)
} else {
// println("(base, acc)= "+(base, acc))
val outerSelect = localTyper typed Apply(Select(base, acc), Nil)
// achieves the same as: localTyper typed atPos(tree.pos)(outerPath(base, base.tpe.typeSymbol, outerFor.outerClass))
// println("(b, tpsym, outerForI, outerFor, outerClass)= "+ (base, base.tpe.typeSymbol, outerFor, sel.symbol.owner, outerFor.outerClass))
// println("outerSelect = "+ outerSelect)
- return transform(treeCopy.Apply(tree, treeCopy.Select(eqsel, outerSelect, eq), args))
+ transform(treeCopy.Apply(tree, treeCopy.Select(eqsel, outerSelect, eq), args))
}
case _ =>
@@ -250,7 +250,7 @@ private[collection] final class INode[K, V](bn: MainNode[K, V], g: Gen) extends
if (ct.isReadOnly || (startgen eq in.gen)) in.rec_lookup(k, hc, lev + 5, this, startgen, ct)
else {
if (GCAS(cn, cn.renewed(startgen, ct), ct)) rec_lookup(k, hc, lev, parent, startgen, ct)
- else return RESTART // used to be throw RestartException
+ else RESTART // used to be throw RestartException
}
case sn: SNode[K, V] => // 2) singleton node
if (sn.hc == hc && equal(sn.k, k, ct)) sn.v.asInstanceOf[AnyRef]
@@ -241,7 +241,7 @@ self =>
if (p(a(j).asInstanceOf[T])) j += 1
else return false
}
- return true
+ true
}
override def exists(p: T => Boolean): Boolean = {
@@ -269,7 +269,7 @@ self =>
if (p(a(j).asInstanceOf[T])) return true
else j += 1
}
- return false
+ false
}
override def find(p: T => Boolean): Option[T] = {
@@ -298,7 +298,7 @@ self =>
if (p(elem)) return Some(elem)
else j += 1
}
- return None
+ None
}
override def drop(n: Int): ParArrayIterator = {
@@ -227,7 +227,7 @@ object ScalaRunTime {
if (iv == fv) return iv
val lv = fv.toLong
- if (lv == fv) return hash(lv)
+ if (lv == fv) hash(lv)
else fv.hashCode
}
def hash(lv: Long): Int = {
@@ -758,7 +758,7 @@ trait Parsers {
if (elems.length == num) Success(elems.toList, in0)
else p0(in0) match {
case Success(x, rest) => elems += x ; applyp(rest)
- case ns: NoSuccess => return ns
+ case ns: NoSuccess => ns
}
applyp(in)
@@ -904,7 +904,7 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
if (isAliasType) return true
if (isType && isNonClassType) return false
if (isRefinementClass) return false
- return true
+ true
}
/** The variance of this symbol. */
@@ -43,7 +43,7 @@ private[scala] object ReflectionUtils {
def isAbstractFileClassLoader(clazz: Class[_]): Boolean = {
if (clazz == null) return false
if (clazz.getName == "scala.tools.nsc.interpreter.AbstractFileClassLoader") return true
- return isAbstractFileClassLoader(clazz.getSuperclass)
+ isAbstractFileClassLoader(clazz.getSuperclass)
@som-snytt

som-snytt Feb 28, 2013

Contributor

This was my other merge conflict this evening, also benign. I got rid of all the returns.

}
def inferClasspath(cl: ClassLoader): String = cl match {
case cl: java.net.URLClassLoader =>

0 comments on commit 256e468

Please sign in to comment.