Skip to content

Commit

Permalink
perf(fingerprint): do not resolve already resolved fingerprints
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <[email protected]>
  • Loading branch information
oSumAtrIX committed Sep 18, 2022
1 parent 2f7e62e commit 4bfd7eb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ object MethodFingerprintUtils {
* @param context The context on which to resolve the [MethodFingerprint].
* @param classDef The class of the matching [Method].
* @param forData The [BytecodeData] to host proxies.
* @return True if the resolution was successful, false otherwise.
* @return True if the resolution was successful or if the fingerprint is already resolved, false otherwise.
*/
fun MethodFingerprint.resolve(forData: BytecodeData, context: Method, classDef: ClassDef): Boolean {
val methodFingerprint = this

if (methodFingerprint.result != null) return true

if (methodFingerprint.returnType != null && !context.returnType.startsWith(methodFingerprint.returnType))
return false

Expand Down

0 comments on commit 4bfd7eb

Please sign in to comment.