From 56e5105d0d65bc17ee15f3cb3ff40c234b666706 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Wed, 11 Dec 2024 10:12:05 +1000 Subject: [PATCH] Fix `Order{,Descending}` preventing GitLab CI from building tests --- src/BizHawk.Common/Extensions/CollectionExtensions.cs | 2 ++ .../Emulation.Common/Database/FirmwareDatabaseTests.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/BizHawk.Common/Extensions/CollectionExtensions.cs b/src/BizHawk.Common/Extensions/CollectionExtensions.cs index 2dc9ea4e3f5..8e894958268 100644 --- a/src/BizHawk.Common/Extensions/CollectionExtensions.cs +++ b/src/BizHawk.Common/Extensions/CollectionExtensions.cs @@ -234,6 +234,7 @@ public static int IndexOf(this IReadOnlyList list, T elem) return null; } +#if !NET7_0_OR_GREATER /// shorthand for this.OrderBy(static e => e), backported from .NET 7 public static IOrderedEnumerable Order(this IEnumerable source) where T : IComparable @@ -243,6 +244,7 @@ public static IOrderedEnumerable Order(this IEnumerable source) public static IOrderedEnumerable OrderDescending(this IEnumerable source) where T : IComparable => source.OrderByDescending(ReturnSelf); +#endif /// /// diff --git a/src/BizHawk.Tests/Emulation.Common/Database/FirmwareDatabaseTests.cs b/src/BizHawk.Tests/Emulation.Common/Database/FirmwareDatabaseTests.cs index 36938737f53..d2c5a9a8f95 100644 --- a/src/BizHawk.Tests/Emulation.Common/Database/FirmwareDatabaseTests.cs +++ b/src/BizHawk.Tests/Emulation.Common/Database/FirmwareDatabaseTests.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using System.Linq; +#if !NET7_0_OR_GREATER using BizHawk.Common.CollectionExtensions; +#endif using BizHawk.Common.StringExtensions; using BizHawk.Emulation.Common;