From 3750235190176d40290186b1578e2513fc6feace Mon Sep 17 00:00:00 2001 From: Gilles Dubochet Date: Sun, 11 Apr 2010 16:38:58 +0000 Subject: [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. --- src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') 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) -- cgit v1.2.3