From f640d5e99917455a96d9736293da6c346e788c6f Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Wed, 30 Nov 2022 18:38:13 +0000 Subject: [PATCH] Use in parameters for Vector3d static methods --- VpSharp/src/Vector3d.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/VpSharp/src/Vector3d.cs b/VpSharp/src/Vector3d.cs index 7276f12..bf40ac8 100644 --- a/VpSharp/src/Vector3d.cs +++ b/VpSharp/src/Vector3d.cs @@ -118,7 +118,7 @@ public struct Vector3d : IEquatable, IFormattable /// The first source vector. /// The second source vector. /// The summed vector. - public static Vector3d operator +(Vector3d left, Vector3d right) + public static Vector3d operator +(in Vector3d left, in Vector3d right) { return new( left.X + right.X, @@ -133,7 +133,7 @@ public struct Vector3d : IEquatable, IFormattable /// The first source vector. /// The second source vector. /// The difference vector. - public static Vector3d operator -(Vector3d left, Vector3d right) + public static Vector3d operator -(in Vector3d left, in Vector3d right) { return new( left.X - right.X, @@ -148,7 +148,7 @@ public struct Vector3d : IEquatable, IFormattable /// The first source vector. /// The second source vector. /// The product vector. - public static Vector3d operator *(Vector3d left, Vector3d right) + public static Vector3d operator *(in Vector3d left, in Vector3d right) { return new( left.X * right.X, @@ -163,7 +163,7 @@ public struct Vector3d : IEquatable, IFormattable /// The vector value. /// The scalar value. /// The scaled vector. - public static Vector3d operator *(Vector3d left, double right) + public static Vector3d operator *(in Vector3d left, double right) { return new( left.X * right, @@ -178,7 +178,7 @@ public struct Vector3d : IEquatable, IFormattable /// The scalar value. /// The vector value. /// The scaled vector. - public static Vector3d operator *(double left, Vector3d right) + public static Vector3d operator *(double left, in Vector3d right) { return new( left * right.X, @@ -193,7 +193,7 @@ public struct Vector3d : IEquatable, IFormattable /// The first source vector. /// The second source vector. /// The vector resulting from the division. - public static Vector3d operator /(Vector3d left, Vector3d right) + public static Vector3d operator /(in Vector3d left, in Vector3d right) { return new( left.X / right.X, @@ -208,7 +208,7 @@ public struct Vector3d : IEquatable, IFormattable /// The vector value. /// The scalar value. /// The vector resulting from the division. - public static Vector3d operator /(Vector3d left, double right) + public static Vector3d operator /(in Vector3d left, double right) { return new( left.X / right, @@ -222,7 +222,7 @@ public struct Vector3d : IEquatable, IFormattable /// /// The source vector. /// The negated vector. - public static Vector3d operator -(Vector3d value) + public static Vector3d operator -(in Vector3d value) { return Zero - value; } @@ -276,7 +276,7 @@ public struct Vector3d : IEquatable, IFormattable /// /// The source vector. /// The absolute value vector. - public static Vector3d Abs(Vector3d value) + public static Vector3d Abs(in Vector3d value) { return new( Math.Abs(value.X), @@ -433,7 +433,7 @@ public struct Vector3d : IEquatable, IFormattable /// /// The source vector. /// The square root vector. - public static Vector3d SquareRoot(Vector3d value) + public static Vector3d SquareRoot(in Vector3d value) { return new( Math.Sqrt(value.X),