Skip to content

Commit 05ec8d9

Browse files
committed
use ThrowIfNegative
1 parent ab0a51b commit 05ec8d9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Renci.SshNet/OrderedDictionary.netstandard.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -487,14 +487,8 @@ public void Clear()
487487
public virtual void CopyTo(T[] array, int arrayIndex)
488488
{
489489
ThrowHelper.ThrowIfNull(array);
490-
#if NET
491-
ArgumentOutOfRangeException.ThrowIfNegative(arrayIndex);
492-
#else
493-
if (arrayIndex < 0)
494-
{
495-
throw new ArgumentOutOfRangeException(nameof(arrayIndex));
496-
}
497-
#endif
490+
ThrowHelper.ThrowIfNegative(arrayIndex);
491+
498492
if (array.Length - arrayIndex < Count)
499493
{
500494
throw new ArgumentException(

0 commit comments

Comments
 (0)