diff --git a/src/ImageSharp/Common/Helpers/RuntimeUtility.cs b/src/ImageSharp/Common/Helpers/RuntimeUtility.cs
index 66e2fc9dc5..9c8348c0dc 100644
--- a/src/ImageSharp/Common/Helpers/RuntimeUtility.cs
+++ b/src/ImageSharp/Common/Helpers/RuntimeUtility.cs
@@ -1,4 +1,4 @@
-// Copyright (c) Six Labors.
+// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System;
@@ -11,6 +11,8 @@ namespace SixLabors.ImageSharp.Common.Helpers
///
internal static class RuntimeUtility
{
+ // Tuple swap uses 2 more IL bytes
+#pragma warning disable IDE0180 // Use tuple to swap values
///
/// Swaps the two references.
///
@@ -20,10 +22,7 @@ namespace SixLabors.ImageSharp.Common.Helpers
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void Swap(ref T a, ref T b)
{
- // Tuple swap uses 2 more IL bytes
-#pragma warning disable IDE0180 // Use tuple to swap values
T tmp = a;
-#pragma warning restore IDE0180 // Use tuple to swap values
a = b;
b = tmp;
}
@@ -38,11 +37,10 @@ namespace SixLabors.ImageSharp.Common.Helpers
public static void Swap(ref Span a, ref Span b)
{
// Tuple swap uses 2 more IL bytes
-#pragma warning disable IDE0180 // Use tuple to swap values
Span tmp = a;
-#pragma warning restore IDE0180 // Use tuple to swap values
a = b;
b = tmp;
}
+#pragma warning restore IDE0180 // Use tuple to swap values
}
}
diff --git a/src/ImageSharp/Formats/Webp/Lossy/Vp8EncIterator.cs b/src/ImageSharp/Formats/Webp/Lossy/Vp8EncIterator.cs
index cac598a727..0043d6d281 100644
--- a/src/ImageSharp/Formats/Webp/Lossy/Vp8EncIterator.cs
+++ b/src/ImageSharp/Formats/Webp/Lossy/Vp8EncIterator.cs
@@ -2,7 +2,6 @@
// Licensed under the Six Labors Split License.
using System;
-using SixLabors.ImageSharp.Common.Helpers;
namespace SixLabors.ImageSharp.Formats.Webp.Lossy
{
@@ -755,11 +754,12 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy
public void SwapOut()
{
+ // Tuple swap uses 2 more IL bytes
#pragma warning disable IDE0180 // Use tuple to swap values
byte[] tmp = this.YuvOut;
-#pragma warning restore IDE0180 // Use tuple to swap values
this.YuvOut = this.YuvOut2;
this.YuvOut2 = tmp;
+#pragma warning restore IDE0180 // Use tuple to swap values
}
public void NzToBytes()