From 4cf6ab40f6534dc0a8f479b3d561b5a3bcd8b403 Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Sat, 11 May 2024 22:33:18 +0300 Subject: [PATCH] Use `MustDisposeResource` annotation to appease ReSharper inspections --- osu.Game/Database/EmptyRealmSet.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Database/EmptyRealmSet.cs b/osu.Game/Database/EmptyRealmSet.cs index 02dfa50fe5..c34974cb03 100644 --- a/osu.Game/Database/EmptyRealmSet.cs +++ b/osu.Game/Database/EmptyRealmSet.cs @@ -6,6 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; +using JetBrains.Annotations; using Realms; using Realms.Schema; @@ -15,8 +16,12 @@ namespace osu.Game.Database { private IList emptySet => Array.Empty(); + [MustDisposeResource] public IEnumerator GetEnumerator() => emptySet.GetEnumerator(); + + [MustDisposeResource] IEnumerator IEnumerable.GetEnumerator() => emptySet.GetEnumerator(); + public int Count => emptySet.Count; public T this[int index] => emptySet[index]; public int IndexOf(object? item) => item == null ? -1 : emptySet.IndexOf((T)item);