Avoids continuous background compiler running

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@24424 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2011-03-09 11:35:21 +00:00
parent 009b827882
commit 2934866ea5
1 changed files with 9 additions and 4 deletions

View File

@ -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
}
}