diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-04-11 16:38:58 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-04-11 16:38:58 +0000 |
commit | 3750235190176d40290186b1578e2513fc6feace (patch) | |
tree | 2bfab8f6e8d4ee09f319b6024f2ad043518d315a | |
parent | 97221868047a32d64c4f6a1748fde97d37a16b53 (diff) | |
download | scala-3750235190176d40290186b1578e2513fc6feace.tar.gz scala-3750235190176d40290186b1578e2513fc6feace.tar.bz2 scala-3750235190176d40290186b1578e2513fc6feace.zip |
[scaladoc] Fixes efficiency issue in the way pa...
[scaladoc] Fixes efficiency issue in the way pages are generated. This
issue can lead to the same page being generated a very large number
of times and probably explains why building Scaladoc had been so slow
previously. Donna helped identifying the issue, review by malayeri.
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala index 92a75f420e..348dc4b26c 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala @@ -63,11 +63,12 @@ class HtmlFactory(val universe: Universe) { val written = mutable.HashSet.empty[DocTemplateEntity] - def writeTemplate(tpl: DocTemplateEntity): Unit = { - new page.Template(tpl) writeFor this - written += tpl - tpl.templates filter { t => !(written contains t) } map (writeTemplate(_)) - } + def writeTemplate(tpl: DocTemplateEntity): Unit = + if (!(written contains tpl)) { + new page.Template(tpl) writeFor this + written += tpl + tpl.templates map (writeTemplate(_)) + } writeTemplate(universe.rootPackage) |