Skip to content

Commit 4d044c6

Browse files
committed
Increase initial capacity of TreeAddr map
Size it so that it corresponds roughly with the initial size of the buffer.
1 parent 2249961 commit 4d044c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeBuffer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TreeBuffer extends TastyBuffer(50000) {
2121
private var numOffsets = 0
2222

2323
/** A map from trees to the address at which a tree is pickled. */
24-
private val treeAddrs = util.IntMap[Tree]()
24+
private val treeAddrs = util.IntMap[Tree](initialCapacity = 8192)
2525

2626
def registerTreeAddr(tree: Tree): Addr =
2727
val idx = treeAddrs(tree)

0 commit comments

Comments
 (0)