Skip to content

Commit 2282bab

Browse files
committed
Update example
1 parent c2bc4f6 commit 2282bab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/collections/Collections.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ inline fun <T> Iterable<T>.onEach(operation: (T) -> Unit): Iterable<T> {
1414
}
1515

1616
inline fun <T, R> Iterable<T>.flatMap(transformation: (T) -> Iterable<R>): List<R> {
17-
val list = arrayListOf<R>()
17+
val list = ArrayList<R>()
1818
for (elem in this) {
1919
list.addAll(transformation(elem))
2020
}
2121
return list
2222
}
2323

2424
inline fun <T> Iterable<T>.filter(predicate: (T) -> Boolean): List<T> {
25-
val list = arrayListOf<T>()
25+
val list = ArrayList<T>()
2626
for (elem in this) {
2727
if (predicate(elem)) {
2828
list.add(elem)

0 commit comments

Comments
 (0)