Call compactIfPossible where it's possible in BinaryJava*
It helps to avoid retaining a lot of redundant empty SmartList's instances
This commit is contained in:
@@ -132,7 +132,7 @@ inline fun <T> measureTimeMillisWithResult(block: () -> T) : Pair<Long, T> {
|
||||
return Pair(System.currentTimeMillis() - start, result)
|
||||
}
|
||||
|
||||
public fun <T> Iterable<Iterable<T>>.flattenTo(c: MutableList<T>): List<T> {
|
||||
fun <T, C : MutableCollection<in T>> Iterable<Iterable<T>>.flattenTo(c: C): C {
|
||||
for (element in this) {
|
||||
c.addAll(element)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user