Bloc
Bloc copied to clipboard
[Question] - About hash methods
Hello,
I have a question about the hash methods.
(BlMatrix2D translation: 2 @ 6) hash = (BlMatrix2D shear: 6 @ 2) hash.
(BlMatrix2D reflection: 2 @ 6) hash = (BlMatrix2D shear: 6 @ 2) hash.
(BlStrokeStyle default miterLimit: 4.0; dashOffset: 2.0; hash) = (BlStrokeStyle default miterLimit: 2.0; dashOffset: 4.0; hash).
(BlVector2D new x: 4 y: 5) hash = (BlVector2D new x: 5 y: 4) hash.
(BlLinearLayout vertical cellSpacing: 5; weightSum: 2) hash = (BlLinearLayout vertical cellSpacing: 2; weightSum: 5) hash.
All the "=" above are true. Is this normal ?
I think they should not be equal. I discover this while i was trying to save Bloc property inside a Dictonary.
Also BlInsets is missing the hash method.
Given objects a and b, when a = b then a hash = b hash.
So, not strictly a bug, but when hashes are well distributed, dictionaries and other objects are more efficient.
We can improve it, building the the hash answer with more collaborator objects.