diff --git a/MoonTools.ECS.csproj b/MoonTools.ECS.csproj index 2f2b5e6..5cd9326 100644 --- a/MoonTools.ECS.csproj +++ b/MoonTools.ECS.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net7.0 enable x64 true diff --git a/src/FilterSignature.cs b/src/FilterSignature.cs index 8fd65ec..3877391 100644 --- a/src/FilterSignature.cs +++ b/src/FilterSignature.cs @@ -21,7 +21,25 @@ namespace MoonTools.ECS public bool Equals(FilterSignature other) { - return Included.SetEquals(other.Included) && Excluded.SetEquals(other.Excluded); + // workaround for HashSet.SetEquals generating garbage + // maybe fixed in .NET 8? + foreach (var included in Included) + { + if (!other.Included.Contains(included)) + { + return false; + } + } + + foreach (var excluded in Excluded) + { + if (!other.Excluded.Contains(excluded)) + { + return false; + } + } + + return true; } public override int GetHashCode()