but also, if you're only using one class here, why...
# getting-started
s
but also, if you're only using one class here, why not just use
filterIsInstance<T>
?
🧵 3
🐛 1
r
is this faster in terms of performance?
s
faster than what?
r
just doing a filter { }
s
if you just
filter
, you'll have to cast afterwards
r
Untitled.cpp
Cannot use 'T' as reified type parameter. Use a class instead.
s
Copy code
inline fun <reified T : AbstractBase> find(): T {
    return instances.filterIsInstance<T>().first()
}
r
and i can use inline for methods on classes I assume
yes
s
yep
r
@Shawn thanks a lot for your help
👍 1