Skip to content

Commit

Permalink
Remove unnecessary map lambda in test code
Browse files Browse the repository at this point in the history
  • Loading branch information
schalkms committed Dec 25, 2021
1 parent 48a28fc commit d6e7e7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Expand Up @@ -36,9 +36,7 @@ class ClassCountVisitorSpec : Spek({
})

private fun getClassCount(files: Array<KtFile>): Int {
return files
.map { getData(it) }
.sum()
return files.sumOf { getData(it) }
}

private fun getData(file: KtFile): Int {
Expand Down
Expand Up @@ -14,9 +14,7 @@ class KtFileCountVisitorSpec : Spek({
compileContentForTest(default),
compileContentForTest(complexClass)
)
val count = files
.map { getData(it) }
.sum()
val count = files.sumOf { getData(it) }
assertThat(count).isEqualTo(2)
}
}
Expand Down

0 comments on commit d6e7e7c

Please sign in to comment.