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

Commit

Permalink
No need for dstrcmp in object.d (#3165)
Browse files Browse the repository at this point in the history
No need for dstrcmp in object.d
merged-on-behalf-of: Mathias LANG <pro.mathias.lang@gmail.com>
  • Loading branch information
andralex authored Jul 26, 2020
1 parent b8fb84c commit 32ffc72
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/object.d
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,14 @@ class TypeInfo
return hashOf(this.toString());
}

override int opCmp(Object o)
override int opCmp(Object rhs)
{
import core.internal.string : dstrcmp;

if (this is o)
if (this is rhs)
return 0;
TypeInfo ti = cast(TypeInfo)o;
auto ti = cast(TypeInfo) rhs;
if (ti is null)
return 1;
return dstrcmp(this.toString(), ti.toString());
return __cmp(this.toString(), ti.toString());
}

override bool opEquals(Object o)
Expand Down Expand Up @@ -3010,7 +3008,6 @@ private size_t getArrayHash(const scope TypeInfo element, const scope void* ptr,
|| cast(const TypeInfo_Interface) element;
}

import core.internal.traits : externDFunc;
if (!hasCustomToHash(element))
return hashOf(ptr[0 .. elementSize * count]);

Expand Down

0 comments on commit 32ffc72

Please sign in to comment.