mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #82240 from jaros3/vector2i-gethashcode
[C#] Use `HashCode.Combine()` for basic composite types instead of xor
This commit is contained in:
commit
42011d8673
@ -723,7 +723,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this AABB.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return _position.GetHashCode() ^ _size.GetHashCode();
|
||||
return HashCode.Combine(_position, _size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1123,7 +1123,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this basis.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Row0.GetHashCode() ^ Row1.GetHashCode() ^ Row2.GetHashCode();
|
||||
return HashCode.Combine(Row0, Row1, Row2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1308,7 +1308,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this color.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return R.GetHashCode() ^ G.GetHashCode() ^ B.GetHashCode() ^ A.GetHashCode();
|
||||
return HashCode.Combine(R, G, B, A);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -414,7 +414,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this plane.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return _normal.GetHashCode() ^ _d.GetHashCode();
|
||||
return HashCode.Combine(_normal, _d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1001,7 +1001,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this projection.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z, W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -800,7 +800,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this quaternion.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z, W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -459,7 +459,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this rect.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return _position.GetHashCode() ^ _size.GetHashCode();
|
||||
return HashCode.Combine(_position, _size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -419,7 +419,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this rect.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return _position.GetHashCode() ^ _size.GetHashCode();
|
||||
return HashCode.Combine(_position, _size);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -626,7 +626,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this transform.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return X.GetHashCode() ^ Y.GetHashCode() ^ Origin.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Origin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -653,7 +653,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this transform.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Basis.GetHashCode() ^ Origin.GetHashCode();
|
||||
return HashCode.Combine(Basis, Origin);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1000,7 +1000,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode();
|
||||
return HashCode.Combine(X, Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -556,7 +556,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode();
|
||||
return HashCode.Combine(X, Y);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -1102,7 +1102,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -611,7 +611,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -884,7 +884,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z, W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -632,7 +632,7 @@ namespace Godot
|
||||
/// <returns>A hash code for this vector.</returns>
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return Y.GetHashCode() ^ X.GetHashCode() ^ Z.GetHashCode() ^ W.GetHashCode();
|
||||
return HashCode.Combine(X, Y, Z, W);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user