Skip to content

Commit

Permalink
fix hashcode recursion only for the recursive case (anchor)
Browse files Browse the repository at this point in the history
  • Loading branch information
barapiiro committed May 28, 2024
1 parent d155cf9 commit 2c57ca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion YamlDotNet/RepresentationModel/YamlMappingNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ public override int GetHashCode()
foreach (var entry in children)
{
hashCode = CombineHashCodes(hashCode, entry.Key);
hashCode = CombineHashCodes(hashCode, entry.Value.Start);
hashCode = entry.Value.Anchor.IsEmpty
? CombineHashCodes(hashCode, entry.Value)
: CombineHashCodes(hashCode, entry.Value.Anchor);
}
return hashCode;
}
Expand Down

0 comments on commit 2c57ca2

Please sign in to comment.