summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/Global.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-03-09 11:35:21 +0000
committerMartin Odersky <odersky@gmail.com>2011-03-09 11:35:21 +0000
commit9f964bcfd06810bbc73c375cee8adc15780e71d1 (patch)
treec0a22194fa624b0d6b6c34a561017fa237ba939b /src/compiler/scala/tools/nsc/interactive/Global.scala
parent41c6dc0087679bd4e4376671e60bd9c893ff14e0 (diff)
downloadscala-9f964bcfd06810bbc73c375cee8adc15780e71d1.tar.gz
scala-9f964bcfd06810bbc73c375cee8adc15780e71d1.tar.bz2
scala-9f964bcfd06810bbc73c375cee8adc15780e71d1.zip
Avoids continuous background compiler running
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/Global.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/Global.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/Global.scala b/src/compiler/scala/tools/nsc/interactive/Global.scala
index ab21d9dcc5..44b871f1a3 100644
--- a/src/compiler/scala/tools/nsc/interactive/Global.scala
+++ b/src/compiler/scala/tools/nsc/interactive/Global.scala
@@ -99,10 +99,15 @@ class Global(settings: Settings, reporter: Reporter)
protected var getParsedEnteredResponses = new ResponseMap
private def cleanResponses(rmap: ResponseMap): Unit = {
- val staleSources = rmap.keys.toList filter { getUnit(_).isEmpty }
- for (source <- staleSources) {
- for (r <- rmap(source)) r raise new NoSuchUnitError(source.file)
- rmap -= source
+ for ((source, rs) <- rmap.toList) {
+ for (r <- rs) {
+ if (getUnit(source).isEmpty)
+ r raise new NoSuchUnitError(source.file)
+ if (r.isComplete)
+ rmap(source) -= r
+ }
+ if (rmap(source).isEmpty)
+ rmap -= source
}
}