mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Made hashing better
This commit is contained in:
parent
63c6421413
commit
f3e9224a45
1 changed files with 2 additions and 11 deletions
|
@ -41,17 +41,8 @@ namespace System
|
|||
// Ensure that 0 and -0 have the same hash code
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (sizeof(int) == sizeof(double))
|
||||
{
|
||||
var val = (double)this;
|
||||
return *(int*)(&val);
|
||||
}
|
||||
else
|
||||
{
|
||||
int64 value = *(int64*)(&d);
|
||||
return ((int32)value) ^ ((int32)(value >> 32));
|
||||
}
|
||||
return *((int*)&d) ^ ((int32*)&d)[1];
|
||||
|
||||
}
|
||||
|
||||
public bool IsInfinity
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue