Created
March 22, 2019 16:53
-
-
Save sajjadyousefnia/6d671a0e3185275399fb389e1d21a204 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
inline fun <reified T> | |
Iterable<*>.filterIsInstance(): List<T> | |
val destination = mutableListOf<T>() | |
for (element in this) { | |
if (element is T) { | |
destination.add(element) | |
} | |
} | |
return destination | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment