we were kinda talking about this earlier in <#C092...
# codereview
s
we were kinda talking about this earlier in #general, but no, there isn’t really a performance difference if there isn’t any exception-throwing happening. If you’re really 110%™ certain
A
can always be cast to
B
, then the language lets you assert that unsafely. If you think there’s at all a chance you’ll run into a
ClassCastException
(and that you can safely recover from this), use
as?
and use tools like safe navigation and/or the elvis operator to handle it