daily update on 20230716 by nitload youmu, another bug in linked list

This commit is contained in:
Nitload
2023-07-16 05:30:04 +08:00
parent 28a9c22f01
commit 80cdd610ce
23 changed files with 21 additions and 11 deletions
+12 -6
View File
@@ -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()