From 080c1b504ffca368a9e205e368a08ea136daafdf Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 23 May 2020 16:00:15 +0530 Subject: [PATCH] ZoneTree: changes done as per ByteTree refactoring. --- DnsServerCore/Dns/Zones/ZoneTree.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DnsServerCore/Dns/Zones/ZoneTree.cs b/DnsServerCore/Dns/Zones/ZoneTree.cs index 73e92de6..0bd862f0 100644 --- a/DnsServerCore/Dns/Zones/ZoneTree.cs +++ b/DnsServerCore/Dns/Zones/ZoneTree.cs @@ -501,8 +501,7 @@ namespace DnsServerCore.Dns.Zones { byte[] bKey = ConvertToByteKey(domain); - Node closestNode = FindClosestNode(bKey); - NodeValue removedValue = closestNode.RemoveValue(bKey); + NodeValue removedValue = _root.RemoveValue(bKey, out Node closestNode); if (removedValue == null) { value = default; @@ -528,7 +527,7 @@ namespace DnsServerCore.Dns.Zones T zone = v.Value; if ((zone != null) && ((zone is SubDomainZone) || (zone is CacheZone))) { - current.RemoveValue(v.Key); //remove node value + current.RemoveValue(v.Key, out _); //remove node value current.CleanUp(); } } @@ -545,8 +544,8 @@ namespace DnsServerCore.Dns.Zones List zones = new List(); byte[] bKey = ConvertToByteKey(domain); - Node closestNode = FindClosestNode(bKey); - NodeValue nodeValue = closestNode.GetValue(bKey); + + NodeValue nodeValue = _root.FindNodeValue(bKey, out Node closestNode); if (nodeValue != null) { T zone = nodeValue.Value; @@ -589,7 +588,8 @@ namespace DnsServerCore.Dns.Zones List zones = new List(); byte[] bKey = ConvertToByteKey(domain); - Node closestNode = FindClosestNode(bKey); + + _ = _root.FindNodeValue(bKey, out Node closestNode); Node current = closestNode; NodeValue value;