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

Commit

Permalink
Merge pull request #1707 from WalterWaldron/fixHashOf
Browse files Browse the repository at this point in the history
[REG 2.072] Revert object.hashOf changes from "use array interface to hashOf()"
  • Loading branch information
MartinNowak committed Dec 4, 2016
2 parents 422c8f7 + 5c187e0 commit 0b1e32a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/object.d
Expand Up @@ -3176,7 +3176,15 @@ struct Test
size_t hashOf(T)(auto ref T arg, size_t seed = 0)
{
import core.internal.hash;
return core.internal.hash.hashOf((cast(void*)&arg)[0 .. T.sizeof], seed);
return core.internal.hash.hashOf(arg, seed);
}

unittest
{
// Issue # 16654 / 16764
auto a = [1];
auto b = a.dup;
assert(hashOf(a) == hashOf(b));
}

bool _xopEquals(in void*, in void*)
Expand Down

0 comments on commit 0b1e32a

Please sign in to comment.