From 19672c86bb65ff70811a2a3bb5e23cfc6492f886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Tue, 9 Jan 2024 21:44:10 +0100 Subject: [PATCH] Fix DataCenterExtensions.DescendantsAt() comparing the wrong node name. Closes #108. --- src/formats/Data/DataCenterExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/formats/Data/DataCenterExtensions.cs b/src/formats/Data/DataCenterExtensions.cs index 4eb9532..a059d5f 100644 --- a/src/formats/Data/DataCenterExtensions.cs +++ b/src/formats/Data/DataCenterExtensions.cs @@ -174,10 +174,10 @@ void Evaluate(DataCenterNode node, ReadOnlySpan path) foreach (var child in node.Children) { - if (node.Name != name) + if (child.Name != name) continue; - if (path.Length == 1) + if (remaining is []) results.Add(child); else Evaluate(child, remaining);