File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
compiler/src/dotty/tools/dotc/sbt Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -271,14 +271,12 @@ private class ExtractDependenciesCollector(rec: DependencyRecorder) extends tpd.
271
271
// Avoid cycles by remembering both the types (testcase:
272
272
// tests/run/enum-values.scala) and the symbols of named types (testcase:
273
273
// tests/pos-java-interop/i13575) we've seen before.
274
- val seen = new util.HashSet [Symbol | Type ](64 )
275
- def traverse (tp : Type ): Unit = if (! seen.contains(tp)) {
276
- seen += tp
274
+ val seen = new util.EqHashSet [Symbol | Type ](128 ) // 64 still needs to grow often for scala3-compiler
275
+ def traverse (tp : Type ): Unit = if seen.add(tp) then {
277
276
tp match {
278
277
case tp : NamedType =>
279
278
val sym = tp.symbol
280
- if ! seen.contains(sym) && ! sym.is(Package ) then
281
- seen += sym
279
+ if ! sym.is(Package ) && seen.add(sym) then
282
280
addDependency(sym)
283
281
if ! sym.isClass then traverse(tp.info)
284
282
traverse(tp.prefix)
You can’t perform that action at this time.
0 commit comments