[Issue 18768] New: object.getArrayHash with custom toHash shouldn't just sum hashes of array elements
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 16 21:45:32 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18768
Issue ID: 18768
Summary: object.getArrayHash with custom toHash shouldn't just
sum hashes of array elements
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: n8sh.secondary at hotmail.com
Currently:
```
if(!hasCustomToHash(element))
return hashOf(ptr[0 .. elementSize * count], 0);
size_t hash = 0;
foreach(size_t i; 0 .. count)
hash += element.getHash(ptr + i * elementSize);
return hash;
```
--
More information about the Digitalmars-d-bugs
mailing list