Skip to content

Commit 6c6ed71

Browse files
committed
refactor(java): replace with lambda
1 parent 3c69a59 commit 6c6ed71

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

chapi-ast-java/src/main/kotlin/chapi/ast/javaast/JavaFullIdentListener.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,14 @@ open class JavaFullIdentListener(fileName: String, val classes: Array<String>) :
119119
}
120120

121121
open fun buildImplements(ctx: JavaParser.ClassDeclarationContext): Array<String> {
122-
var implements = arrayOf<String>()
123-
for (_type in ctx.typeList()) {
122+
return ctx.typeList().map { _type ->
124123
var target = this.warpTargetFullType(_type.text).targetType
125124
if (target == "") {
126125
target = _type.text
127126
}
128-
implements += target
129-
}
130-
return implements
127+
128+
target
129+
}.toTypedArray()
131130
}
132131

133132
override fun exitClassDeclaration(ctx: JavaParser.ClassDeclarationContext?) {

0 commit comments

Comments
 (0)