Commit 742786c2 authored by Michael Comella's avatar Michael Comella Committed by Sebastian Kaspari
Browse files

Closes #651 - post: Remove inline of mapNotNull to fix jacoco.

parent 312222e8
......@@ -39,6 +39,7 @@ fun <T> JSONArray?.toList(): List<T> {
return listOf()
}
// #2305: inline this function when Android gradle plugin v3.4.0 is released
/**
* Returns a list containing only the non-null results of applying the given [transform] function
* to each element in the original collection as returned by [getFromArray]. If [getFromArray]
......@@ -49,7 +50,7 @@ fun <T> JSONArray?.toList(): List<T> {
* jsonArray.mapNotNull(JSONArray::getJSONObject) { jsonObj -> jsonObj.getString("author") }
* ```
*/
inline fun <T, R : Any> JSONArray.mapNotNull(getFromArray: JSONArray.(index: Int) -> T, transform: (T) -> R?): List<R> {
fun <T, R : Any> JSONArray.mapNotNull(getFromArray: JSONArray.(index: Int) -> T, transform: (T) -> R?): List<R> {
val transformedResults = mutableListOf<R>()
for (i in 0 until this.length()) {
try {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment