summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-01-10 05:38:50 +0000
committerPaul Phillips <paulp@improving.org>2011-01-10 05:38:50 +0000
commitd06ccf64f0bc8a0b86da21cd8118d4de02f93c6b (patch)
treebb283e143596cf825dfb2b255da9f8ff9bebaa55 /src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
parent34d82221cca365ce6b57d7baaed58bac8152ac53 (diff)
downloadscala-d06ccf64f0bc8a0b86da21cd8118d4de02f93c6b.tar.gz
scala-d06ccf64f0bc8a0b86da21cd8118d4de02f93c6b.tar.bz2
scala-d06ccf64f0bc8a0b86da21cd8118d4de02f93c6b.zip
Fixed a mis-deprecation step where remove was r...
Fixed a mis-deprecation step where remove was replaced with filterNot on a mutable collection. Thanks to richard emberson for finding it. I used what git fu I have searching for others, but no dice. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
index 82c09b6501..cdc18ed566 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
@@ -94,7 +94,7 @@ abstract class TreeBrowsers {
/** Return the index'th child of parent */
def getChild(parent: Any, index: Int): AnyRef =
- packChildren(parent).drop(index).head
+ packChildren(parent)(index)
/** Return the number of children this 'parent' has */
def getChildCount(parent: Any): Int =
@@ -102,16 +102,16 @@ abstract class TreeBrowsers {
/** Return the index of the given child */
def getIndexOfChild(parent: Any, child: Any): Int =
- packChildren(parent).dropWhile(c => c != child).length
+ packChildren(parent) indexOf child
/** Return the root node */
def getRoot(): AnyRef = program
/** Test whether the given node is a leaf */
- def isLeaf(node: Any): Boolean = packChildren(node).length == 0
+ def isLeaf(node: Any): Boolean = packChildren(node).isEmpty
def removeTreeModelListener(l: TreeModelListener): Unit =
- listeners filterNot (_ == l)
+ listeners = listeners filterNot (_ == l)
/** we ignore this message for now */
def valueForPathChanged(path: TreePath, newValue: Any) = ()