Saxonite v1.2.10
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user