Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Issue 3917 - opEquals for Ojbect could be more efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
complexmath committed Jul 20, 2010
1 parent 01eb050 commit 8409adb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/object_.d
Expand Up @@ -155,7 +155,8 @@ bool opEquals(Object lhs, Object rhs)
if (lhs is null || rhs is null) return false;

// If same exact type => one call to method opEquals
if (typeid(lhs) == typeid(rhs)) return lhs.opEquals(rhs);
if (typeid(lhs) is typeid(rhs) || typeid(lhs).opEquals(typeid(rhs)))
return lhs.opEquals(rhs);

// General case => symmetric calls to method opEquals
return lhs.opEquals(rhs) && rhs.opEquals(lhs);
Expand Down

0 comments on commit 8409adb

Please sign in to comment.