Skip to content

Commit 4d354a7

Browse files
committed
Alternative fix for #2506 that does not force dirs
As stated in #2506 `lazy` was droped to make it volatile. It turns out that the dirs is not always used and epensive to compute. In `implicit_cache.scala` only need dirs 1 out of 30 times.
1 parent b7cafd8 commit 4d354a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/io/ZipArchive.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ final class FileZipArchive(file: JFile) extends ZipArchive(file) {
149149
override def sizeOption: Option[Int] = Some(zipEntry.getSize.toInt)
150150
}
151151

152-
val (root, allDirs) = {
152+
@volatile lazy val (root, allDirs) = {
153153
val root = new DirEntry("/")
154154
val dirs = mutable.HashMap[String, DirEntry]("/" -> root)
155155
val zipFile = openZipFile()

0 commit comments

Comments
 (0)