File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
utbot-core/src/main/kotlin/org/utbot/common Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11package org.utbot.common
22
3- // TODO: add docs
3+ /* *
4+ * If [condition] is true, returns list containing only elements, matching [predicate].
5+ * Otherwise, returns list with all elements of collection
6+ */
47inline fun <T > Iterable<T>.filterWhen (condition : Boolean , predicate : (T ) -> Boolean ): List <T > =
58 if (condition)
69 this .filter(predicate)
710 else
811 this .toList()
912
10- // TODO: add docs
13+ /* *
14+ * If [condition] is true, returns sequence containing only elements, matching [predicate].
15+ * Otherwise, leaves sequence unchanged
16+ */
1117fun <T > Sequence<T>.filterWhen (condition : Boolean , predicate : (T ) -> Boolean ): Sequence <T > =
1218 if (condition)
1319 this .filter(predicate)
You can’t perform that action at this time.
0 commit comments