Skip to content

Commit

Permalink
cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
lrytz committed Feb 18, 2021
1 parent 7f16fec commit 888ef94
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
4 changes: 2 additions & 2 deletions project/MimaFilters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ object MimaFilters extends AutoPlugin {
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree#Tree.redWithRight"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree#Tree.redWithLeftRight"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree#Tree.blackWithLeftRight"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.partitionKeys"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.partitionKeys"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree#Tree.redWithLeft"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.partitionKeys"),
ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.filterKeys"),
)

override val buildSettings = Seq(
Expand Down
15 changes: 0 additions & 15 deletions src/library/scala/collection/immutable/RedBlackTree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -989,21 +989,6 @@ private[collection] object RedBlackTree {
blacken(fk(t))
}

def filterKeys[A, B](t: Tree[A, B], f: A => Boolean): Tree[A, B] = if(t eq null) null else {
def fk(t: Tree[A, B]): Tree[A, B] = {
val k = t.key
val l = t.left
val r = t.right
val l2 = if(l eq null) null else fk(l)
val keep = f(k)
val r2 = if(r eq null) null else fk(r)
if(!keep) join2(l2, r2)
else if((l2 eq l) && (r2 eq r)) t
else join(l2, k, t.value, r2)
}
blacken(fk(t))
}

private[this] val null2 = (null, null)

def partitionEntries[A, B](t: Tree[A, B], p: (A, B) => Boolean): (Tree[A, B], Tree[A, B]) = if(t eq null) (null, null) else {
Expand Down
2 changes: 1 addition & 1 deletion test/junit/scala/tools/nsc/parser/ParserTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ParserTest extends BytecodeTesting{
import compiler._, global._
val run = new Run
run.compileSources(newSourceFile(code) :: Nil)
assert(!reporter.hasErrors)
assertFalse(reporter.hasErrors)
val unit = run.units.toList.head
def codeOf(pos: Position) = new String(pos.source.content.slice(pos.start, pos.end))
val List(x, y) = unit.body.collect { case vd : ValDef => vd }.takeRight(2)
Expand Down

0 comments on commit 888ef94

Please sign in to comment.