From 9e7d8cde794f76da228317d257187c0f030fea5c Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 17 Feb 2024 18:04:25 +0530 Subject: [PATCH] ApexZone: code refactoring changes. --- DnsServerCore/Dns/Zones/ApexZone.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DnsServerCore/Dns/Zones/ApexZone.cs b/DnsServerCore/Dns/Zones/ApexZone.cs index 6fc8eaa1..ab273aec 100644 --- a/DnsServerCore/Dns/Zones/ApexZone.cs +++ b/DnsServerCore/Dns/Zones/ApexZone.cs @@ -141,25 +141,25 @@ namespace DnsServerCore.Dns.Zones #region protected - protected void CleanupHistory(List history) + protected void CleanupHistory() { DnsSOARecordData soa = _entries[DnsResourceRecordType.SOA][0].RDATA as DnsSOARecordData; DateTime expiry = DateTime.UtcNow.AddSeconds(-soa.Expire); int index = 0; - while (index < history.Count) + while (index < _zoneHistory.Count) { //check difference sequence - if (history[index].GetAuthRecordInfo().DeletedOn > expiry) + if (_zoneHistory[index].GetAuthRecordInfo().DeletedOn > expiry) break; //found record to keep //skip to next difference sequence index++; int soaCount = 1; - while (index < history.Count) + while (index < _zoneHistory.Count) { - if (history[index].Type == DnsResourceRecordType.SOA) + if (_zoneHistory[index].Type == DnsResourceRecordType.SOA) { soaCount++; @@ -171,15 +171,15 @@ namespace DnsServerCore.Dns.Zones } } - if (index == history.Count) + if (index == _zoneHistory.Count) { //delete entire history - history.Clear(); + _zoneHistory.Clear(); return; } //remove expired records - history.RemoveRange(0, index); + _zoneHistory.RemoveRange(0, index); } protected void InitNotify(DnsServer dnsServer)