- 1.png (77.77 KiB) Viewed 6913 times
- 2.png (26.34 KiB) Viewed 6913 times
1.3.1仍然存在这个Bug
Code: Select all
HashSet<Type> visitedElements = new HashSet<Type>();
Code: Select all
else if (stack.Contains(elementType)
&& visitedElements.Add(elementType))
{
var list = new List<Type>(stack.Reverse());
var index = list.IndexOf(elementType);
stack.Clear();
for (int i = 0; i < index; i++)
{
stack.Push(list[i]);
}
stack.Push(targetType);
for (int i = index; i < list.Count; i++)
{
stack.Push(list[i]);
}
}