Skip to content

Commit

Permalink
[jsoizo#103] Optimize writeNext Method
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdgusya committed Jul 23, 2022
1 parent f184ac2 commit 2bbaea2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ class CsvFileWriter internal constructor(
}

private fun writeNext(row: List<Any?>) {
val rowStr = row.map { field ->
val rowStr = row.joinToString(ctx.delimiter.toString()) { field ->
if (field == null) {
ctx.nullCode
} else {
attachQuote(field.toString())
}
}.joinToString(ctx.delimiter.toString())
}
writer.print(rowStr)
}

Expand Down Expand Up @@ -158,4 +158,4 @@ class CsvFileWriter internal constructor(
if (shouldQuote) append(ctx.quote.char)
}
}
}
}

0 comments on commit 2bbaea2

Please sign in to comment.