Skip to content

Commit

Permalink
Merge pull request #6103 from Terochi/slim-RO-list-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Jan 3, 2024
2 parents 3eb7a68 + 15e5808 commit 4fe6df7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions osu.Framework/Lists/SlimReadOnlyListWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ public SlimReadOnlyListWrapper(List<T> list)

IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();

public void Add(T item) => throw new NotImplementedException();
public void Add(T item) => throw new NotSupportedException();

public int Add(object? value) => throw new NotImplementedException();
public int Add(object? value) => throw new NotSupportedException();

void IList.Clear() => throw new NotImplementedException();
void IList.Clear() => throw new NotSupportedException();

public bool Contains(object? value) => ((IList)list).Contains(value);

public int IndexOf(object? value) => ((IList)list).IndexOf(value);

public void Insert(int index, object? value) => ((IList)list).Insert(index, value);
public void Insert(int index, object? value) => throw new NotSupportedException();

public void Remove(object? value) => throw new NotImplementedException();
public void Remove(object? value) => throw new NotSupportedException();

void IList.RemoveAt(int index) => throw new NotImplementedException();
void IList.RemoveAt(int index) => throw new NotSupportedException();

public bool IsFixedSize => ((IList)list).IsFixedSize;

Expand All @@ -51,16 +51,16 @@ public SlimReadOnlyListWrapper(List<T> list)
object? IList.this[int index]
{
get => ((IList)list)[index];
set => throw new NotImplementedException();
set => throw new NotSupportedException();
}

void ICollection<T>.Clear() => throw new NotImplementedException();
void ICollection<T>.Clear() => throw new NotSupportedException();

public bool Contains(T item) => list.Contains(item);

public void CopyTo(T[] array, int arrayIndex) => list.CopyTo(array, arrayIndex);

public bool Remove(T item) => throw new NotImplementedException();
public bool Remove(T item) => throw new NotSupportedException();

public void CopyTo(Array array, int index) => ((ICollection)list).CopyTo(array, index);

Expand All @@ -76,14 +76,14 @@ public SlimReadOnlyListWrapper(List<T> list)

public int IndexOf(T item) => list.IndexOf(item);

public void Insert(int index, T item) => throw new NotImplementedException();
public void Insert(int index, T item) => throw new NotSupportedException();

void IList<T>.RemoveAt(int index) => throw new NotImplementedException();
void IList<T>.RemoveAt(int index) => throw new NotSupportedException();

public T this[int index]
{
get => list[index];
set => throw new NotImplementedException();
set => throw new NotSupportedException();
}
}
}

0 comments on commit 4fe6df7

Please sign in to comment.