[Issue 18541] comparison `==` of two typeid() should always be rewritten as a "is"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Mar 2 14:03:53 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18541
--- Comment #8 from Steven Schveighoffer <schveiguy at yahoo.com> ---
Yeah, there is no inlining of it. There is a bit of magic in the compiler for
Object == Object, and I think that magic is stopping the inlining.
Of course, the compiler magic could be made to simply do the `is` comparison
first, and then call the object function (we can take `lhs is rhs` out of the
function itself).
I think this would be a worthy enhancement request, especially considering the
performance benefits. I'm not sure how keen someone is to delve into updating
that code, it's kind of a mess.
--
More information about the Digitalmars-d-bugs
mailing list