Skip to content

Commit 8b3be74

Browse files
authored
fix: Fixed MethodImpl usage (#127) [skip ci]
1 parent 2160d7b commit 8b3be74

7 files changed

+34
-6
lines changed

src/NetEvolve.Arguments/Argument_ThrowIfGreaterThan.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ public static partial class Argument
1212
/// <param name="other">The value to compare with <paramref name="value"/>.</param>
1313
/// <param name="paramName">The name of the parameter with which <paramref name="value"/> corresponds.</param>
1414
[DebuggerStepThrough]
15-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1615
[StackTraceHidden]
16+
#if NET8_0_OR_GREATER
17+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
18+
#else
19+
[MethodImpl(MethodImplOptions.NoInlining)]
20+
#endif
1721
public static void ThrowIfGreaterThan<T>(
1822
T value,
1923
T other,

src/NetEvolve.Arguments/Argument_ThrowIfGreaterThanOrEqual.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ public static partial class Argument
1111
/// <param name="other">The value to compare with <paramref name="value"/>.</param>
1212
/// <param name="paramName">The name of the parameter with which <paramref name="value"/> corresponds.</param>
1313
[DebuggerStepThrough]
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1514
[StackTraceHidden]
15+
#if NET8_0_OR_GREATER
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
#else
18+
[MethodImpl(MethodImplOptions.NoInlining)]
19+
#endif
1620
public static void ThrowIfGreaterThanOrEqual<T>(
1721
T value,
1822
T other,

src/NetEvolve.Arguments/Argument_ThrowIfLessThan.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ public static partial class Argument
1111
/// <param name="other">The value to compare with <paramref name="value"/>.</param>
1212
/// <param name="paramName">The name of the parameter with which <paramref name="value"/> corresponds.</param>
1313
[DebuggerStepThrough]
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1514
[StackTraceHidden]
15+
#if NET8_0_OR_GREATER
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
#else
18+
[MethodImpl(MethodImplOptions.NoInlining)]
19+
#endif
1620
public static void ThrowIfLessThan<T>(
1721
T value,
1822
T other,

src/NetEvolve.Arguments/Argument_ThrowIfLessThanOrEqual.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ public static partial class Argument
1111
/// <param name="other">The value to compare with <paramref name="value"/>.</param>
1212
/// <param name="paramName">The name of the parameter with which <paramref name="value"/> corresponds.</param>
1313
[DebuggerStepThrough]
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1514
[StackTraceHidden]
15+
#if NET8_0_OR_GREATER
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
#else
18+
[MethodImpl(MethodImplOptions.NoInlining)]
19+
#endif
1620
public static void ThrowIfLessThanOrEqual<T>(
1721
T value,
1822
T other,

src/NetEvolve.Arguments/Argument_ThrowIfNull.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ public static partial class Argument
1111
/// <param name="argument">The reference type argument to validate as non-null.</param>
1212
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
1313
[DebuggerStepThrough]
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1514
[StackTraceHidden]
15+
#if NET6_0_OR_GREATER
16+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17+
#else
18+
[MethodImpl(MethodImplOptions.NoInlining)]
19+
#endif
1620
public static void ThrowIfNull(
1721
[NotNull] object? argument,
1822
[CallerArgumentExpression(nameof(argument))] string? paramName = null

src/NetEvolve.Arguments/Argument_ThrowIfNullOrEmpty.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ public static partial class Argument
1414
/// <exception cref="ArgumentException"><paramref name="argument"/> is empty.</exception>
1515
[DebuggerStepThrough]
1616
[StackTraceHidden]
17+
#if NET7_0_OR_GREATER
1718
[MethodImpl(MethodImplOptions.AggressiveInlining)]
19+
#else
20+
[MethodImpl(MethodImplOptions.NoInlining)]
21+
#endif
1822
public static void ThrowIfNullOrEmpty(
1923
[NotNull] string? argument,
2024
[CallerArgumentExpression(nameof(argument))] string? paramName = null

src/NetEvolve.Arguments/Argument_ThrowIfNullOrWhiteSpace.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ public static partial class Argument
1313
/// <exception cref="ArgumentNullException"><paramref name="argument"/> is null.</exception>
1414
/// <exception cref="ArgumentException"><paramref name="argument"/> is empty or consists only of white-space characters.</exception>
1515
[DebuggerStepThrough]
16-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1716
[StackTraceHidden]
17+
#if NET8_0_OR_GREATER
18+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
19+
#else
20+
[MethodImpl(MethodImplOptions.NoInlining)]
21+
#endif
1822
public static void ThrowIfNullOrWhiteSpace(
1923
[NotNull] string? argument,
2024
[CallerArgumentExpression(nameof(argument))] string? paramName = null

0 commit comments

Comments
 (0)