As far as I'm aware, is uses isinst opcode under the hood, which only differs from the castclass opcode that explicit cast uses when the type check fails.
That would mean the type cast is already performed, so there's no need to cast the object again. We can simply get a reference and use it with the obj is Foo foo pattern.
I realize this is really nitpicking even if I'm correct about the behavior, but I was just reading through the library to get a basic grip of how things work, and I figured I'd send a useless PR to squeeze out 1 more cycle from the CPU.
As far as I'm aware,
is
usesisinst
opcode under the hood, which only differs from thecastclass
opcode that explicit cast uses when the type check fails. That would mean the type cast is already performed, so there's no need to cast the object again. We can simply get a reference and use it with theobj is Foo foo
pattern.I realize this is really nitpicking even if I'm correct about the behavior, but I was just reading through the library to get a basic grip of how things work, and I figured I'd send a useless PR to squeeze out 1 more cycle from the CPU.