Skip to content

Commit c12ddc5

Browse files
authored
Merge pull request scala#7205 from joshlemer/champ-is-the-champ
Remove OldHashMap/OldHashSet
2 parents 056e1e9 + 5762002 commit c12ddc5

File tree

24 files changed

+56
-2530
lines changed

24 files changed

+56
-2530
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4367,7 +4367,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
43674367
// in principle we should pack the types of each branch before lubbing, but lub doesn't really work for existentials anyway
43684368
// in the special (though common) case where the types are equal, it pays to pack before comparing
43694369
// especially virtpatmat needs more aggressive unification of skolemized types
4370-
// this breaks src/library/scala/collection/immutable/TrieIterator.scala
4370+
// this breaks src/library/scala/collection/immutable/TrieIterator.scala (which as of 2.13 doesn't actually exist anymore)
43714371
// annotated types need to be lubbed regardless (at least, continuations break if you bypass them like this)
43724372
def samePackedTypes = (
43734373
!isPastTyper

src/library/scala/collection/immutable/Map.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,6 @@ trait MapOps[K, +V, +CC[X, +Y] <: MapOps[X, Y, CC, _], +C <: MapOps[K, V, CC, C]
134134
@SerialVersionUID(3L)
135135
object Map extends MapFactory[Map] {
136136

137-
// getenv not getProperty for Scala.js friendliness.
138-
// TODO remove before 2.13.0-RC1? see scala/collection-strawman#572
139-
private final val useBaseline: Boolean =
140-
System.getenv("SCALA_COLLECTION_IMMUTABLE_USE_BASELINE") == "true"
141-
142137
class WithDefault[K, +V](val underlying: Map[K, V], val defaultValue: K => V)
143138
extends AbstractMap[K, V]
144139
with MapOps[K, V, Map, WithDefault[K, V]] {
@@ -389,7 +384,7 @@ object Map extends MapFactory[Map] {
389384
else if (key == key2) new Map4(key1, value1, key2, value, key3, value3, key4, value4)
390385
else if (key == key3) new Map4(key1, value1, key2, value2, key3, value, key4, value4)
391386
else if (key == key4) new Map4(key1, value1, key2, value2, key3, value3, key4, value)
392-
else (if (useBaseline) OldHashMap.empty[K, V1] else HashMap.empty[K, V1]).updated(key1,value1).updated(key2, value2).updated(key3, value3).updated(key4, value4).updated(key, value)
387+
else HashMap.empty[K, V1].updated(key1,value1).updated(key2, value2).updated(key3, value3).updated(key4, value4).updated(key, value)
393388
def remove(key: K): Map[K, V] =
394389
if (key == key1) new Map3(key2, value2, key3, value3, key4, value4)
395390
else if (key == key2) new Map3(key1, value1, key3, value3, key4, value4)

0 commit comments

Comments
 (0)