Created
December 11, 2018 14:00
-
-
Save sajjadyousefnia/4aab7221b12c846632c97582766ce1dd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NotNull | |
public static final List notInlinedFilter(@NotNull List list, @NotNull Function1 predicate) { | |
Intrinsics.checkParameterIsNotNull(list, "list"); | |
Intrinsics.checkParameterIsNotNull(predicate, "predicate"); | |
Iterable $receiver$iv = (Iterable)list; | |
Collection destination$iv$iv = (Collection)(new ArrayList()); | |
Iterator var5 = $receiver$iv.iterator(); | |
while(var5.hasNext()) { | |
Object element$iv$iv = var5.next(); | |
if ((Boolean)predicate.invoke(element$iv$iv)) { | |
destination$iv$iv.add(element$iv$iv); | |
} | |
} | |
return (List)destination$iv$iv; | |
} | |
public static final void notInlinedTest() { | |
List list = CollectionsKt.listOf(new Integer[]{1, 2, 3}); | |
List newList = notInlinedFilter(list, (Function1)new Function1<Integer, Boolean>() { | |
@Override | |
public Boolean invoke(Integer integer) { | |
return integer < 2; | |
} | |
}); | |
System.out.println(newList); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment