@@ -21,7 +21,7 @@ internal static partial class Guard
2121 /// <typeparam name="TValue">The type of the value.</typeparam>
2222 /// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
2323 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
24- public static void NotNull < TValue > ( [ NotNull ] TValue ? value , [ CallerArgumentExpression ( " value" ) ] string ? parameterName = null )
24+ public static void NotNull < TValue > ( [ NotNull ] TValue ? value , [ CallerArgumentExpression ( nameof ( value ) ) ] string ? parameterName = null )
2525 where TValue : class =>
2626 ArgumentNullException . ThrowIfNull ( value , parameterName ) ;
2727
@@ -33,7 +33,7 @@ public static void NotNull<TValue>([NotNull]TValue? value, [CallerArgumentExpres
3333 /// <exception cref="ArgumentNullException"><paramref name="value"/> is null.</exception>
3434 /// <exception cref="ArgumentException"><paramref name="value"/> is empty or contains only blanks.</exception>
3535 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
36- public static void NotNullOrWhiteSpace ( [ NotNull ] string ? value , string parameterName )
36+ public static void NotNullOrWhiteSpace ( [ NotNull ] string ? value , string parameterName )
3737 {
3838 if ( ! string . IsNullOrWhiteSpace ( value ) )
3939 {
@@ -221,27 +221,6 @@ public static void MustBeSizedAtLeast<T>(ReadOnlySpan<T> source, int minLength,
221221 ThrowHelper . ThrowArgumentOutOfRangeExceptionForMustBeSizedAtLeast ( minLength , parameterName ) ;
222222 }
223223
224- /// <summary>
225- /// Verifies, that the `source` span has the length of 'minLength', or longer.
226- /// </summary>
227- /// <typeparam name="T">The element type of the spans.</typeparam>
228- /// <param name="source">The target span.</param>
229- /// <param name="minLength">The minimum length.</param>
230- /// <param name="parameterName">The name of the parameter that is to be checked.</param>
231- /// <exception cref="ArgumentException">
232- /// <paramref name="source"/> has less than <paramref name="minLength"/> items.
233- /// </exception>
234- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
235- public static void MustBeSizedAtLeast < T > ( Span < T > source , int minLength , string parameterName )
236- {
237- if ( source . Length >= minLength )
238- {
239- return ;
240- }
241-
242- ThrowHelper . ThrowArgumentOutOfRangeExceptionForMustBeSizedAtLeast ( minLength , parameterName ) ;
243- }
244-
245224 /// <summary>
246225 /// Verifies that the 'destination' span is not shorter than 'source'.
247226 /// </summary>
@@ -253,29 +232,7 @@ public static void MustBeSizedAtLeast<T>(Span<T> source, int minLength, string p
253232 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
254233 public static void DestinationShouldNotBeTooShort < TSource , TDest > (
255234 ReadOnlySpan < TSource > source ,
256- Span < TDest > destination ,
257- string destinationParamName )
258- {
259- if ( destination . Length >= source . Length )
260- {
261- return ;
262- }
263-
264- ThrowHelper . ThrowArgumentException ( "Destination span is too short!" , destinationParamName ) ;
265- }
266-
267- /// <summary>
268- /// Verifies that the 'destination' span is not shorter than 'source'.
269- /// </summary>
270- /// <typeparam name="TSource">The source element type.</typeparam>
271- /// <typeparam name="TDest">The destination element type.</typeparam>
272- /// <param name="source">The source span.</param>
273- /// <param name="destination">The destination span.</param>
274- /// <param name="destinationParamName">The name of the argument for 'destination'.</param>
275- [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
276- public static void DestinationShouldNotBeTooShort < TSource , TDest > (
277- Span < TSource > source ,
278- Span < TDest > destination ,
235+ ReadOnlySpan < TDest > destination ,
279236 string destinationParamName )
280237 {
281238 if ( destination . Length >= source . Length )
0 commit comments