diff options
author | Jonas Herzig <me@johni0702.de> | 2021-06-05 10:19:21 +0200 |
---|---|---|
committer | Jonas Herzig <me@johni0702.de> | 2021-06-05 11:11:14 +0200 |
commit | c2118df80e5f0f602ede84958c59fd00cc7f2b38 (patch) | |
tree | 1359cf6dc180c5e1535157c8a18807e71ea4f039 | |
parent | 744b9288f6aa9cdabe1d3ec8da96f63709cf3f67 (diff) | |
download | Remap-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.
-rw-r--r-- | src/main/kotlin/com/replaymod/gradle/remap/PsiPatterns.kt | 3 |
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 |