Skip to content

Commit 955599f

Browse files
committed
Fix NoSuchElementException in MixinAnnotationTargetInspection
1 parent 52f7a1f commit 955599f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/kotlin/platform/mixin/inspection/MixinAnnotationTargetInspection.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,16 @@ class MixinAnnotationTargetInspection : MixinInspection() {
8989
}
9090

9191
private fun addFilterMessage(message: String, stats: Map<String, Int>): String {
92-
if (stats.isEmpty()) {
92+
val statsItr = stats.entries.asSequence().filter { it.value != 0 }.iterator()
93+
if (!statsItr.hasNext()) {
9394
return message
9495
}
96+
9597
return buildString {
9698
append(message)
9799
append(" (")
98-
val it = stats.entries.asSequence().filter { it.value != 0 }.iterator()
99-
append(it.next().let { (k, v) -> "$v filtered out by $k" })
100-
for ((k, v) in it) {
100+
append(statsItr.next().let { (k, v) -> "$v filtered out by $k" })
101+
for ((k, v) in statsItr) {
101102
append(", $v more by $k")
102103
}
103104
append(')')

0 commit comments

Comments
 (0)