From 81f80352c1a885dd3ebaaef76e4112eaa1de0f55 Mon Sep 17 00:00:00 2001 From: subhra74 Date: Wed, 12 Jan 2022 12:57:27 +0530 Subject: [PATCH] Update GenericOrderedDictionary.cs --- .../Lib/Common/Collections/GenericOrderedDictionary.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/XDM/XDM_CoreFx/Lib/Common/Collections/GenericOrderedDictionary.cs b/app/XDM/XDM_CoreFx/Lib/Common/Collections/GenericOrderedDictionary.cs index e4bae0f..ac741e0 100644 --- a/app/XDM/XDM_CoreFx/Lib/Common/Collections/GenericOrderedDictionary.cs +++ b/app/XDM/XDM_CoreFx/Lib/Common/Collections/GenericOrderedDictionary.cs @@ -19,7 +19,10 @@ namespace XDM.Core.Lib.Common.Collections { lock (this) { - keys.Add(key); + if (!dict.ContainsKey(key)) + { + keys.Add(key); + } dict[key] = value; } } @@ -46,7 +49,10 @@ namespace XDM.Core.Lib.Common.Collections { lock (this) { - keys.Add(key); + if (!dict.ContainsKey(key)) + { + keys.Add(key); + } dict[key] = value; } }