Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undone a breaking change in the way the object tracker works. #399

Merged
merged 1 commit into from Apr 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Src/Core/Equivalency/ObjectTracker.cs
Expand Up @@ -13,7 +13,7 @@ internal class ObjectTracker : ICloneable2
#region Private Definitions

private readonly CyclicReferenceHandling handling;
private HashSet<ObjectReference> references = new HashSet<ObjectReference>();
private List<ObjectReference> orderedReferences = new List<ObjectReference>();

#endregion

Expand All @@ -36,7 +36,7 @@ public bool IsCyclicReference(ObjectReference reference)

if (reference.IsComplexType)
{
if (references.Contains(reference))
if (orderedReferences.Contains(reference))
{
isCyclic = true;
if (handling == CyclicReferenceHandling.ThrowException)
Expand All @@ -47,7 +47,7 @@ public bool IsCyclicReference(ObjectReference reference)
}
else
{
references.Add(reference);
orderedReferences.Add(reference);
}
}

Expand All @@ -65,7 +65,7 @@ public object Clone()
{
return new ObjectTracker(handling)
{
references = new HashSet<ObjectReference>(references)
orderedReferences = new List<ObjectReference>(orderedReferences)
};
}
}
Expand Down