From 52fc9daf07c47edd123cde1f3a17503617608fdc Mon Sep 17 00:00:00 2001 From: Andy Howard Date: Sun, 11 Dec 2022 15:09:36 +0000 Subject: [PATCH] Saxonite v1.2.10 --- SacsStandardBase/Base/Core/SacsQueueDictionary.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/SacsStandardBase/Base/Core/SacsQueueDictionary.cs b/SacsStandardBase/Base/Core/SacsQueueDictionary.cs index 0d27ecd..a857196 100644 --- a/SacsStandardBase/Base/Core/SacsQueueDictionary.cs +++ b/SacsStandardBase/Base/Core/SacsQueueDictionary.cs @@ -58,20 +58,16 @@ namespace Sarand.Net.Standard.Base.Core if (key == null || value == null) return false; lock (dictionary) { - if (dictionary.ContainsKey(key)) + if (!dictionary.ContainsKey(key)) { - // Existsing key. - // Replace value in dictionary. - dictionary[key] = value; - return true; + // New Key - Add to queue before setting value in dictionary. + queue.Enqueue(key); } - // New Key. - // Add to queue and set value in dictionary. - queue.Enqueue(key); + // Value is set or reset in dictionary whetehr previously exists or not. dictionary[key] = value; - return true; } if (SacsSystem.DebugMode) Validate(); + return true; } //-------------------------------------------------------------------