With a struct like this:
struct MyStruct
{
public float a,b;
};
if I try the following:
MyStruct myStruct1 = new MyStruct { b= 1.0f, a = 2.0f};
MyStruct myStruct2 = new MyStruct { b= 1.0f, a = 1.0f};
int hash = myStruct1.GetHashCode();
int hash2 = myStruct2.GetHashCode();
hash and hash2 are different, but trying this:
MyStruct myStruct1 = new MyStruct { a= 1.0f, b = 2.0f};
MyStruct myStruct2 = new MyStruct { a= 1.0f, b = 1.0f};
int hash = myStruct1.GetHashCode();
int hash2 = myStruct2.GetHashCode();
hash and hash2 are the same.
This behavior is different from the one in .NET Framework
With a struct like this:
if I try the following:
hash and hash2 are different, but trying this:
hash and hash2 are the same.
This behavior is different from the one in .NET Framework