summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-07-30 14:42:37 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-07-30 14:42:37 +0000
commitb9bec1c70879297e41e9c0d2aafdf36c7e571c96 (patch)
treec60ea4eb3d59b55511c9067197d21ef77dc18644 /src
parent6148dff45ac80067b86b8e34102dfc315334821e (diff)
downloadscala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.tar.gz
scala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.tar.bz2
scala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.zip
Small refactoring to remove code duplication.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
index 2e300af012..4211ce8119 100644
--- a/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
+++ b/src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala
@@ -59,18 +59,21 @@ class RefinedBuildManager(val settings: Settings) extends Changes with BuildMana
/** Remove the given files from the managed build process. */
def removeFiles(files: Set[AbstractFile]) {
sources --= files
+ update(invalidatedByRemove(files))
+ }
+
+ /** Return the set of invalidated files caused by removing the given files.
+ */
+ private def invalidatedByRemove(files: Set[AbstractFile]): Set[AbstractFile] = {
val changes = new mutable.HashMap[Symbol, List[Change]]
for (f <- files; sym <- definitions(f))
changes += sym -> List(Removed(Class(sym.fullNameString)))
- update(invalidated(files, changes))
+ invalidated(files, changes)
}
def update(added: Set[AbstractFile], removed: Set[AbstractFile]) {
sources --= removed
- val changes = new mutable.HashMap[Symbol, List[Change]]
- for (f <- removed; sym <- definitions(f))
- changes += sym -> List(Removed(Class(sym.fullNameString)))
- update(added ++ invalidated(removed, changes))
+ update(added ++ invalidatedByRemove(removed))
}
/** The given files have been modified by the user. Recompile