Skip to content

Commit 178f9e5

Browse files
committed
RECS0163: Use 'nameof()' expression instead.
[ci skip]
1 parent 4446913 commit 178f9e5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ICSharpCode.SharpZipLib.Tests/TestSupport/RingBuffer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ReadWriteRingBuffer
2626
public ReadWriteRingBuffer( int size )
2727
{
2828
if ( size <= 0 ) {
29-
throw new ArgumentOutOfRangeException( "size" );
29+
throw new ArgumentOutOfRangeException(nameof(size));
3030
}
3131

3232
array_ = new byte[size];
@@ -336,7 +336,7 @@ public byte this[ int index ]
336336
{
337337
get {
338338
if ( ( index < 0 ) || ( index >= array_.Length ) ) {
339-
throw new ArgumentOutOfRangeException( "index" );
339+
throw new ArgumentOutOfRangeException(nameof(index));
340340
}
341341

342342
return array_[ ( tail_ + index ) % array_.Length ];

ICSharpCode.SharpZipLib.Tests/TestSupport/Utils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ public static class Utils
1313
static void Compare(byte[] a, byte[] b)
1414
{
1515
if ( a == null ) {
16-
throw new ArgumentNullException("a");
16+
throw new ArgumentNullException(nameof(a));
1717
}
1818

1919
if ( b == null ) {
20-
throw new ArgumentNullException("b");
20+
throw new ArgumentNullException(nameof(b));
2121
}
2222

2323
Assert.AreEqual(a.Length, b.Length);

0 commit comments

Comments
 (0)