@eurotrash "I'd always assumed that doing one check would be faster than two, but it appears that's not the case, ... When writing a quick benchmark that summed all the integers within an array of type
object[]
, where only a third of the values were actually boxed integers, using
is
and then a cast ended up being
20 times faster than using the
as
operator." C# In Depth by Jon Skeet, Page 123. —
EBrown 1 min ago