-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Closed
Copy link
Labels
area-System.RuntimequestionAnswer questions and provide assistance, not an issue with source code or documentation.Answer questions and provide assistance, not an issue with source code or documentation.
Milestone
Description
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
Metadata
Metadata
Assignees
Labels
area-System.RuntimequestionAnswer questions and provide assistance, not an issue with source code or documentation.Answer questions and provide assistance, not an issue with source code or documentation.