← Back to index
|
Original Bugzilla link
Bug 19975 – object.opEquals(Object lhs, Object rhs) can skip typeid comparison when !lhs.opEquals(rhs)
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-16T19:54:21Z
Last change time
2019-06-28T04:09:53Z
Assigned to
No Owner
Creator
Nathan S.
Comments
Comment #0
by n8sh.secondary — 2019-06-16T19:54:21Z
Current: --- bool opEquals(Object lhs, Object rhs) { if (lhs is rhs) return true; if (lhs is null || rhs is null) return false; if (typeid(lhs) is typeid(rhs) || !__ctfe && typeid(lhs).opEquals(typeid(rhs))) { return lhs.opEquals(rhs); } else { return lhs.opEquals(rhs) && rhs.opEquals(lhs); } } --- Suggested: --- bool opEquals(Object lhs, Object rhs) { if (lhs is rhs) return true; if (lhs is null || rhs is null) return false; if (!lhs.opEquals(rhs)) return false; if (typeid(lhs) is typeid(rhs) || !__ctfe && typeid(lhs).opEquals(typeid(rhs))) { return true; } else { return rhs.opEquals(lhs); } } ---
Comment #1
by dlang-bot — 2019-06-16T20:07:56Z
@n8sh created dlang/druntime pull request #2641 "Issue 19975 - object.opEquals(Object lhs, Object rhs) can skip typeid comparison when !lhs.opEquals(rhs)" mentioning this issue: - Issue 19975 - object.opEquals(Object lhs, Object rhs) can skip typeid comparison when !lhs.opEquals(rhs)
https://github.com/dlang/druntime/pull/2641
Comment #2
by dlang-bot — 2019-06-16T23:29:16Z
dlang/druntime pull request #2641 "Issue 19975 - object.opEquals(Object lhs, Object rhs) can skip typeid comparison when !lhs.opEquals(rhs)" was merged into master: - b15ab7e93c88c810ef7962589550c24253903c4f by Nathan Sashihara: Issue 19975 - object.opEquals(Object lhs, Object rhs) can skip typeid comparison when !lhs.opEquals(rhs)
https://github.com/dlang/druntime/pull/2641
Comment #3
by slavo5150 — 2019-06-28T04:09:53Z
https://github.com/dlang/druntime/pull/2641
was merged.