Skip to content

Commit 05b7fc1

Browse files
committed
Avoid boxing in BitSet +=
Use `addOne` instead.
1 parent 5a0cbb9 commit 05b7fc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ class PositionPickler(
4646
lastIndex = index
4747
lastSpan = span
4848

49-
pickledIndices += index
49+
pickledIndices.addOne(index)
50+
// Note `+=` boxes since it is a generic @inline function in `SetOps`
51+
// that forwards to the specialized `addOne` in `BitSet`. Since the
52+
// current backend does not implement `@inline` we are missing the
53+
// specialization.
5054
}
5155

5256
def pickleSource(source: SourceFile): Unit = {

0 commit comments

Comments
 (0)