-
-
Notifications
You must be signed in to change notification settings - Fork 416
Fix Issue 5835 #735
Fix Issue 5835 #735
Conversation
As always hacking with our poor try to implement collections support in compiler and runtime fixing one issue discovers two (Issue 12303 & Issue 12304). About test failure: it doesn't look like a my fault. |
|| cast(const TypeInfo_AssociativeArray) element | ||
|| cast(const ClassInfo) element | ||
|| cast(const TypeInfo_Interface) element; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downcasts are expensive and explicitly listing all TypeInfos that define getHash might easily break.
Even though it's slow too, I'd suggest to use TypeInfo.getHash for each element.
Changed to use
Yes I can. The fact it's not perfect doesn't mean I can't do it. Also it is already done in runtime and changing of hashing algorithm is a subject of a separate pull request.
Nop. It's Issue 12303 & Issue 12304, the usage is quasi-random. Comment improved. Added |
Fine, we still need to address these issues.
I don't want to add more stuff to TypeInfo currently. When we succeed with the library AA all those cruft can go. |
…ad using array element hash function Issue URL: https://d.puremagic.com/issues/show_bug.cgi?id=5835
Use `hashOf` if possible.
I changed it back as I feel the same, but also I don't see a real reason. What is the problem with choosing a hash algorithm based on number of elements except some bad feeling about it? |
First you never want to do surprising things in an implementation, e.g. because it makes it harder to track down bugs. Say that |
Thanks |
Issue URL: https://d.puremagic.com/issues/show_bug.cgi?id=5835