diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2009-07-30 14:42:37 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2009-07-30 14:42:37 +0000 |
commit | b9bec1c70879297e41e9c0d2aafdf36c7e571c96 (patch) | |
tree | c60ea4eb3d59b55511c9067197d21ef77dc18644 | |
parent | 6148dff45ac80067b86b8e34102dfc315334821e (diff) | |
download | scala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.tar.gz scala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.tar.bz2 scala-b9bec1c70879297e41e9c0d2aafdf36c7e571c96.zip |
Small refactoring to remove code duplication.
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/RefinedBuildManager.scala | 13 |
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 |