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

No need for dstrcmp in object.d #3165

Merged
merged 3 commits into from
Jul 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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