Return Sequence instead of List #6

Merged
marvinelsen merged 8 commits from update-versions into main 2024-09-24 10:10:55 +00:00
Showing only changes of commit 7c16182d61 - Show all commits

View File

@ -20,11 +20,11 @@ internal class CedictParserImpl : CedictParser {
} }
override fun parseCedict(inputStream: InputStream) = override fun parseCedict(inputStream: InputStream) =
inputStream.bufferedReader().useLines { lines -> inputStream
lines.filterNot(::isComment) .bufferedReader()
.map(::toCedictEntry) .readLines()
.toList() .filterNot(::isComment)
} .map(::toCedictEntry)
private fun isComment(line: String) = line[0] == COMMENT_MARKER private fun isComment(line: String) = line[0] == COMMENT_MARKER