Bug 19048 – In core.internal.hash.hashOf reduce template bloat: remove `auto ref` where unneeded and add `const` where possible
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-07-02T15:50:37Z
Last change time
2018-07-03T14:10:55Z
Assigned to
No Owner
Creator
Nathan S.
Comments
Comment #0 by n8sh.secondary — 2018-07-02T15:50:37Z
Reduce template proliferation by not using `auto ref` unnecessarily. Scalars, dynamic arrays, raw pointers, delegates, objects, and associative arrays don't need to be passed by reference. Additionally by adding `const` where we know it's legal we can cause IFTI to produce fewer distinct instantiations. For instance we can avoid having separate template instantiations for `hashOf(const int(1))` and `hashOf(int(1))`.
Comment #1 by n8sh.secondary — 2018-07-02T16:13:07Z