mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
i am silly
This commit is contained in:
parent
9043135390
commit
4a0fc180b5
@ -10,11 +10,11 @@ public class ListStack<T> : IEnumerable<T>
|
||||
|
||||
public int Count => _items.Count;
|
||||
|
||||
public readonly bool RemoveDuplicates;
|
||||
private readonly bool _removeDuplicates;
|
||||
|
||||
public ListStack(bool removeDuplicates)
|
||||
{
|
||||
RemoveDuplicates = removeDuplicates;
|
||||
_removeDuplicates = removeDuplicates;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
@ -22,7 +22,7 @@ public class ListStack<T> : IEnumerable<T>
|
||||
|
||||
public void Push(T item)
|
||||
{
|
||||
if (RemoveDuplicates && _items.Contains(item))
|
||||
if (_removeDuplicates && _items.Contains(item))
|
||||
{
|
||||
RemoveAll(x => EqualityComparer<T>.Default.Equals(x, item));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user