[K/N] Replaced sumBy with sumOf
This commit is contained in:
committed by
Pavel Punegov
parent
53c80cf03b
commit
512010046f
+5
-5
@@ -456,7 +456,7 @@ internal object Devirtualization {
|
||||
}
|
||||
|
||||
context.logMultiple {
|
||||
val edgesCount = constraintGraph.nodes.sumBy {
|
||||
val edgesCount = constraintGraph.nodes.sumOf {
|
||||
(directEdges[it.id + 1] - directEdges[it.id]) + (it.directCastEdges?.size ?: 0)
|
||||
}
|
||||
+"CONSTRAINT GRAPH: ${constraintGraph.nodes.size} nodes, $edgesCount edges"
|
||||
@@ -773,12 +773,12 @@ internal object Devirtualization {
|
||||
private val preliminaryNumberOfNodes =
|
||||
allTypes.size + // A possible source node for each type.
|
||||
functions.size * 2 + // <returns> and <throws> nodes for each function.
|
||||
functions.values.sumBy {
|
||||
it.body.allScopes.sumBy { it.nodes.size } // A node for each DataFlowIR.Node.
|
||||
functions.values.sumOf {
|
||||
it.body.allScopes.sumOf { it.nodes.size } // A node for each DataFlowIR.Node.
|
||||
} +
|
||||
functions.values
|
||||
.sumBy { function ->
|
||||
function.body.allScopes.sumBy {
|
||||
.sumOf { function ->
|
||||
function.body.allScopes.sumOf {
|
||||
it.nodes.count { node ->
|
||||
// A cast if types are different.
|
||||
node is DataFlowIR.Node.Call
|
||||
|
||||
Reference in New Issue
Block a user