From 8268bfdb302d31b5753f93c0bef7be1b9d38e9c0 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 10 Apr 2021 13:38:57 +0530 Subject: [PATCH] CacheZone: using specific capacity for memory optimization. minor code refactoring done. --- DnsServerCore/Dns/Zones/CacheZone.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DnsServerCore/Dns/Zones/CacheZone.cs b/DnsServerCore/Dns/Zones/CacheZone.cs index 904eae57..36140558 100644 --- a/DnsServerCore/Dns/Zones/CacheZone.cs +++ b/DnsServerCore/Dns/Zones/CacheZone.cs @@ -29,8 +29,8 @@ namespace DnsServerCore.Dns.Zones { #region constructor - public CacheZone(string name) - : base(name) + public CacheZone(string name, int capacity) + : base(name, capacity) { } #endregion @@ -201,8 +201,8 @@ namespace DnsServerCore.Dns.Zones { List anyRecords = new List(); - foreach (IReadOnlyList entryRecords in _entries.Values) - anyRecords.AddRange(FilterExpiredRecords(type, entryRecords, serveStale, true)); + foreach (KeyValuePair> entry in _entries) + anyRecords.AddRange(FilterExpiredRecords(type, entry.Value, serveStale, true)); return anyRecords; }