Skip to content

Commit

Permalink
inherits from IReadOnlyList insetad of IEnumerable because of immutab…
Browse files Browse the repository at this point in the history
…ility and the way its used in the processors.
  • Loading branch information
waylaa committed Dec 29, 2023
1 parent 5150f92 commit 0abc848
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions OsuCollectionDownloader/Handlers/Chains/MirrorChain.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
using OsuCollectionDownloader.Objects;
using OsuCollectionDownloader.Handlers.Abstractions;
using OsuCollectionDownloader.Objects;
using System.Collections;

namespace OsuCollectionDownloader.Handlers.Chains;

internal sealed class MirrorChain : IEnumerable<IMirrorHandler>
internal sealed class MirrorChain : IReadOnlyList<IMirrorHandler>
{
private readonly HashSet<IMirrorHandler> _mirrors = [];
private readonly List<IMirrorHandler> _mirrors = [];

public int Count => _mirrors.Count;

public IMirrorHandler this[int index] => _mirrors[index];

public IEnumerator<IMirrorHandler> GetEnumerator()
=> _mirrors.GetEnumerator();
Expand Down

0 comments on commit 0abc848

Please sign in to comment.