Saxonite v1.2.10

This commit is contained in:
Andy Howard
2022-12-11 15:09:36 +00:00
parent 20addc0d92
commit 52fc9daf07
@@ -58,20 +58,16 @@ namespace Sarand.Net.Standard.Base.Core
if (key == null || value == null) return false; if (key == null || value == null) return false;
lock (dictionary) lock (dictionary)
{ {
if (dictionary.ContainsKey(key)) if (!dictionary.ContainsKey(key))
{ {
// Existsing key. // New Key - Add to queue before setting value in dictionary.
// Replace value in dictionary. queue.Enqueue(key);
dictionary[key] = value;
return true;
} }
// New Key. // Value is set or reset in dictionary whetehr previously exists or not.
// Add to queue and set value in dictionary.
queue.Enqueue(key);
dictionary[key] = value; dictionary[key] = value;
return true;
} }
if (SacsSystem.DebugMode) Validate(); if (SacsSystem.DebugMode) Validate();
return true;
} }
//------------------------------------------------------------------- //-------------------------------------------------------------------