Do not close input stream in parse method

This commit is contained in:
Marvin Elsen 2024-09-24 10:33:32 +02:00
parent 78020d6843
commit 7c16182d61
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2

View File

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