Skip to content

Commit

Permalink
Fix DataCenterExtensions.SiblingsAndSelf() behavior for the root node.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrp committed Jan 9, 2024
1 parent 693408a commit 53856a0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/formats/Data/DataCenterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public static IEnumerable<DataCenterNode> SiblingsAndSelf(this DataCenterNode no
{
Check.Null(node);

foreach (var sibling in node.Parent?.UnsafeChildren ?? [])
yield return sibling;
return node.Parent is { } parent ? parent.Children : [node];
}

public static IEnumerable<DataCenterNode> SiblingsAndSelf(this DataCenterNode node, string name)
Expand Down

0 comments on commit 53856a0

Please sign in to comment.