Skip to content

Commit

Permalink
Merge pull request #28153 from frenzibyte/fix-resharper-inspection
Browse files Browse the repository at this point in the history
Use `MustDisposeResource` annotation to appease new ReSharper inspection
  • Loading branch information
peppy authored May 12, 2024
2 parents 6cfe135 + 4cf6ab4 commit ad33647
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osu.Game/Database/EmptyRealmSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using JetBrains.Annotations;
using Realms;
using Realms.Schema;

Expand All @@ -15,8 +16,12 @@ public class EmptyRealmSet<T> : IRealmCollection<T>
{
private IList<T> emptySet => Array.Empty<T>();

[MustDisposeResource]
public IEnumerator<T> 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);
Expand Down

0 comments on commit ad33647

Please sign in to comment.