Return Sequence instead of List #6
@ -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()
|
||||||
|
.readLines()
|
||||||
|
.filterNot(::isComment)
|
||||||
.map(::toCedictEntry)
|
.map(::toCedictEntry)
|
||||||
.toList()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun isComment(line: String) = line[0] == COMMENT_MARKER
|
private fun isComment(line: String) = line[0] == COMMENT_MARKER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user