File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
usvm-ts-dataflow/src/main/kotlin/org/usvm/dataflow/ts/graph Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ class EtsApplicationGraphImpl(
104104 .flatMap { it.methods }
105105 .groupByTo(hashMapOf()) { it.name }
106106 }
107+ private val classMethodsByName by lazy {
108+ projectClassesBySignature.mapValues { (_, clazz) ->
109+ clazz.single().methods.groupBy { it.name }
110+ }
111+ }
107112
108113 private val cacheClassWithIdealSignature: MutableMap <EtsClassSignature , Maybe <EtsClass >> = hashMapOf()
109114 private val cacheMethodWithIdealSignature: MutableMap <EtsMethodSignature , Maybe <EtsMethod >> = hashMapOf()
@@ -227,11 +232,8 @@ class EtsApplicationGraphImpl(
227232
228233 // If the complete signature match failed,
229234 // try to find the unique not-the-same neighbour method in the same class:
230- val neighbors = cls.methods
231- .asSequence()
232- .filter { it.name == callee.name }
235+ val neighbors = classMethodsByName[cls.signature].orEmpty()[callee.name].orEmpty()
233236 .filterNot { it.name == node.method.name }
234- .toList()
235237 if (neighbors.isNotEmpty()) {
236238 val s = neighbors.singleOrNull()
237239 ? : error(" Multiple methods with the same name: $neighbors " )
You can’t perform that action at this time.
0 commit comments