daily update on 20230716 by nitload youmu, another bug in linked list
This commit is contained in:
@@ -109,14 +109,20 @@ namespace StgSharp
|
||||
|
||||
internal LinkedListNode<T> Find(T value)
|
||||
{
|
||||
foreach (LinkedListNode<T> node in this)
|
||||
LinkedListNode<T> enumerator = this._hook;
|
||||
do
|
||||
{
|
||||
if (node._value.Equals(value))
|
||||
{
|
||||
return node;
|
||||
}
|
||||
enumerator = enumerator._next;
|
||||
Console.WriteLine(enumerator.Value.ToString());
|
||||
} while (!enumerator.Value.Equals(value)
|
||||
|| enumerator == _hook);
|
||||
|
||||
if (enumerator == _hook)
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
throw new Exception("Value not found in this LinkedList");
|
||||
|
||||
return enumerator;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
|
||||
Reference in New Issue
Block a user