mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-10 02:35:42 +00:00
Throw ArgumentException not IndexOutOfRangeException
This commit is contained in:
parent
cfd1e4c208
commit
e4f692d599
@ -63,12 +63,12 @@ public struct Vector3d : IEquatable<Vector3d>, IFormattable
|
||||
/// <see cref="ReadOnlySpan{Single}" />. The span must contain at least 3 elements.
|
||||
/// </summary>
|
||||
/// <param name="values">The span of elements to assign to the vector.</param>
|
||||
/// <exception cref="IndexOutOfRangeException"><paramref name="values" /> contains fewer than 3 elements.</exception>
|
||||
/// <exception cref="ArgumentException"><paramref name="values" /> contains fewer than 3 elements.</exception>
|
||||
public Vector3d(ReadOnlySpan<double> values)
|
||||
{
|
||||
if (values.Length < 3)
|
||||
{
|
||||
throw new IndexOutOfRangeException("The specified span has an insufficient number of elements.");
|
||||
throw new ArgumentException("The specified span has an insufficient number of elements.", nameof(values));
|
||||
}
|
||||
|
||||
this = Unsafe.ReadUnaligned<Vector3d>(ref Unsafe.As<double, byte>(ref MemoryMarshal.GetReference(values)));
|
||||
|
Loading…
Reference in New Issue
Block a user