From 2d0e1c4b4fddac1bdcc86b151f2c26fd9a597760 Mon Sep 17 00:00:00 2001 From: wormchen Date: Mon, 22 Jun 2020 10:43:42 +0800 Subject: [PATCH] code optimization --- .../didiglobal/booster/transform/thread/ThreadTransformer.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/booster-transform-thread/src/main/kotlin/com/didiglobal/booster/transform/thread/ThreadTransformer.kt b/booster-transform-thread/src/main/kotlin/com/didiglobal/booster/transform/thread/ThreadTransformer.kt index 2048d26f0..2c93df633 100644 --- a/booster-transform-thread/src/main/kotlin/com/didiglobal/booster/transform/thread/ThreadTransformer.kt +++ b/booster-transform-thread/src/main/kotlin/com/didiglobal/booster/transform/thread/ThreadTransformer.kt @@ -172,8 +172,7 @@ class ThreadTransformer : ClassTransformer { (it.opcode == Opcodes.INVOKESPECIAL) && (it is MethodInsnNode) && (this.desc == it.owner && "" == it.name) - }?.let { init -> - if (init !is MethodInsnNode) return + }?.isInstanceOf { init: MethodInsnNode -> val name = "new${prefix.capitalize()}${this.desc.substringAfterLast('/')}" val desc = "${init.desc.substringBeforeLast(')')}Ljava/lang/String;)L${this.desc};" logger.println(" * ${init.owner}.${init.name}${init.desc} => $type.$name$desc: ${klass.name}.${method.name}${method.desc}")