@@ -77,7 +77,8 @@ IEnumerator IEnumerable.GetEnumerator()
7777 /// </returns>
7878 public TupleDescriptor Head ( int fieldCount )
7979 {
80- ArgumentValidator . EnsureArgumentIsInRange ( fieldCount , 1 , Count , nameof ( fieldCount ) ) ;
80+ ArgumentOutOfRangeException . ThrowIfLessThan ( fieldCount , 1 ) ;
81+ ArgumentOutOfRangeException . ThrowIfGreaterThan ( fieldCount , this . fieldTypes . Length ) ;
8182 var fieldTypes = new Type [ fieldCount ] ;
8283 Array . Copy ( this . fieldTypes , 0 , fieldTypes , 0 , fieldCount ) ;
8384 return new TupleDescriptor ( fieldTypes ) ;
@@ -92,7 +93,8 @@ public TupleDescriptor Head(int fieldCount)
9293 /// </returns>
9394 public TupleDescriptor Tail ( int tailFieldCount )
9495 {
95- ArgumentValidator . EnsureArgumentIsInRange ( tailFieldCount , 1 , Count , nameof ( tailFieldCount ) ) ;
96+ ArgumentOutOfRangeException . ThrowIfLessThan ( tailFieldCount , 1 ) ;
97+ ArgumentOutOfRangeException . ThrowIfGreaterThan ( tailFieldCount , this . fieldTypes . Length ) ;
9698 var fieldTypes = new Type [ tailFieldCount ] ;
9799 Array . Copy ( this . fieldTypes , Count - tailFieldCount , fieldTypes , 0 , tailFieldCount ) ;
98100 return new TupleDescriptor ( fieldTypes ) ;
0 commit comments