aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
authorJonas Herzig <me@johni0702.de>2021-06-05 10:19:21 +0200
committerJonas Herzig <me@johni0702.de>2021-06-05 11:11:14 +0200
commitc2118df80e5f0f602ede84958c59fd00cc7f2b38 (patch)
tree1359cf6dc180c5e1535157c8a18807e71ea4f039 /src/main/kotlin
parent744b9288f6aa9cdabe1d3ec8da96f63709cf3f67 (diff)
downloadRemap-c2118df80e5f0f602ede84958c59fd00cc7f2b38.tar.gz
Remap-c2118df80e5f0f602ede84958c59fd00cc7f2b38.tar.bz2
Remap-c2118df80e5f0f602ede84958c59fd00cc7f2b38.zip
Skip pattern if body (not the entire method) is unchanged
We may still require some signature changes to make it compile, but these are generally not relevant for the pattern functionality itself.
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt
index 3c095c4..a1f6e8b 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt
@@ -38,7 +38,8 @@ internal class PsiPatterns(private val annotationFQN: String) {
}
val replacementBody = replacementMethod.body!!
- if (method.text == replacementMethod.text) return
+ // If the body does not change, then there is no point in applying this pattern
+ if (body.text == replacementBody.text) return
// If either body is empty, then consider the pattern to be disabled
if (body.statements.isEmpty()) return