Kotlin optimization form #1435

This commit is contained in:
Benoit Marty 2020-11-20 09:04:04 +01:00
parent 084b2e8e04
commit eb7ee49096
1 changed files with 4 additions and 4 deletions

View File

@ -66,9 +66,9 @@ class FormattedJsonHttpLogger : HttpLoggingInterceptor.Logger {
}
private fun logJson(formattedJson: String) {
val arr = formattedJson.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
for (s in arr) {
Timber.v(s)
}
formattedJson
.lines()
.dropLastWhile { it.isEmpty() }
.forEach { Timber.v(it) }
}
}