Bug 18768 – object.getArrayHash with custom toHash shouldn't just sum hashes of array elements

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-04-16T21:45:32Z
Last change time
2018-05-18T15:48:11Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-04-16T21:45:32Z
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; ```
Comment #1 by n8sh.secondary — 2018-04-16T22:39:45Z
Comment #2 by github-bugzilla — 2018-05-18T15:48:10Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/5064012515d2954fccccb0884f422c1fd158a146 Fix Issue 18768 - object.getArrayHash with custom toHash shouldn't just sum hashes of array elements https://github.com/dlang/druntime/commit/7605989c06ce07989ac6b601c17537c05645e185 Merge pull request #2166 from n8sh/issue-18768-getArrayHash Fix Issue 18768 - object.getArrayHash with custom toHash shouldn't just sum hashes of array elements merged-on-behalf-of: Jacob Carlborg <[email protected]>