File tree Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Expand file tree Collapse file tree 6 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class GenBCode extends Phase {
43
43
private val superCallsMap = newMutableSymbolMap[Set [ClassSymbol ]]
44
44
def registerSuperCall (sym : Symbol , calls : ClassSymbol ) = {
45
45
val old = superCallsMap.getOrElse(sym, Set .empty)
46
- superCallsMap.put (sym, old + calls)
46
+ superCallsMap.update (sym, old + calls)
47
47
}
48
48
49
49
def outputDir (implicit ctx : Context ): AbstractFile =
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ object Comments {
33
33
def docstring (sym : Symbol ): Option [Comment ] = _docstrings.get(sym)
34
34
35
35
def addDocstring (sym : Symbol , doc : Option [Comment ]): Unit =
36
- doc.map(d => _docstrings.put (sym, d))
36
+ doc.map(d => _docstrings.update (sym, d))
37
37
}
38
38
39
39
/** A `Comment` contains the unformatted docstring as well as a position
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class Devalify extends Optimisation {
43
43
tp.foreachPart(x => x match {
44
44
case TermRef (NoPrefix , _) =>
45
45
val b4 = timesUsedAsType.getOrElseUpdate(x.termSymbol, 0 )
46
- timesUsedAsType.put (x.termSymbol, b4 + 1 )
46
+ timesUsedAsType.update (x.termSymbol, b4 + 1 )
47
47
case _ =>
48
48
})
49
49
}
@@ -55,7 +55,7 @@ class Devalify extends Optimisation {
55
55
56
56
dropCasts(valdef.rhs) match {
57
57
case t : Tree if readingOnlyVals(t) =>
58
- copies.put (valdef.symbol, valdef.rhs)
58
+ copies.update (valdef.symbol, valdef.rhs)
59
59
case _ =>
60
60
}
61
61
visitType(valdef.symbol.info)
@@ -77,7 +77,7 @@ class Devalify extends Optimisation {
77
77
case t : TypeApply => t.args.foreach(x => visitType(x.tpe))
78
78
case t : RefTree =>
79
79
val b4 = used.getOrElseUpdate(t.symbol, 0 )
80
- used.put (t.symbol, b4 + 1 )
80
+ used.update (t.symbol, b4 + 1 )
81
81
case _ =>
82
82
}
83
83
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ class InlineLabelsCalledOnce extends Optimisation {
31
31
isRecursive = true
32
32
}
33
33
if (! isRecursive)
34
- defined.put (d.symbol, d)
34
+ defined.update (d.symbol, d)
35
35
36
36
case t : Apply if t.symbol.is(Label ) =>
37
37
val b4 = timesUsed.getOrElseUpdate(t.symbol, 0 )
38
- timesUsed.put (t.symbol, b4 + 1 )
38
+ timesUsed.update (t.symbol, b4 + 1 )
39
39
40
40
case _ =>
41
41
}
@@ -55,7 +55,7 @@ class InlineLabelsCalledOnce extends Optimisation {
55
55
56
56
case d : DefDef if usedOnce(d) =>
57
57
simplify.println(s " Dropping labeldef (used once) ${d.name} ${timesUsed.get(d.symbol)}" )
58
- defined.put (d.symbol, d)
58
+ defined.update (d.symbol, d)
59
59
EmptyTree
60
60
61
61
case d : DefDef if neverUsed(d) =>
Original file line number Diff line number Diff line change @@ -62,11 +62,11 @@ import scala.collection.mutable
62
62
case t : Literal => t.const.value != null
63
63
64
64
case t : Ident if ! t.symbol.owner.isClass =>
65
- checkGood.put (target, checkGood.getOrElse(target, Set .empty) + t.symbol)
65
+ checkGood.update (target, checkGood.getOrElse(target, Set .empty) + t.symbol)
66
66
true
67
67
68
68
case t : Apply if ! t.symbol.owner.isClass =>
69
- checkGood.put (target, checkGood.getOrElse(target, Set .empty) + t.symbol)
69
+ checkGood.update (target, checkGood.getOrElse(target, Set .empty) + t.symbol)
70
70
true
71
71
72
72
case t : Typed =>
Original file line number Diff line number Diff line change @@ -38,21 +38,21 @@ import scala.collection.mutable
38
38
39
39
def visitor (implicit ctx : Context ): Tree => Unit = {
40
40
case t : ValDef if t.symbol.is(Param ) =>
41
- paramsTimesUsed.put (t.symbol, 0 )
41
+ paramsTimesUsed.update (t.symbol, 0 )
42
42
43
43
case t : ValDef if t.symbol.is(Mutable ) =>
44
44
t.rhs.foreachSubTree { subtree =>
45
45
if (paramsTimesUsed.contains(subtree.symbol) &&
46
46
t.symbol.info.widenDealias <:< subtree.symbol.info.widenDealias) {
47
47
val newSet = possibleRenames.getOrElse(t.symbol, Set .empty) + subtree.symbol
48
- possibleRenames.put (t.symbol, newSet)
48
+ possibleRenames.update (t.symbol, newSet)
49
49
}
50
50
}
51
51
52
52
case t : RefTree if paramsTimesUsed.contains(t.symbol) =>
53
53
val param = t.symbol
54
54
val current = paramsTimesUsed.get(param)
55
- current foreach { c => paramsTimesUsed.put (param, c + 1 ) }
55
+ current foreach { c => paramsTimesUsed.update (param, c + 1 ) }
56
56
57
57
case _ =>
58
58
}
You can’t perform that action at this time.
0 commit comments