From 2ee835d23b1f4af5863b3c34e0aa413fff5dccb6 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 3 Nov 2021 11:51:10 +0100 Subject: [PATCH] Fix removing keys in Dictionary with string keys --- Source/Editor/CustomEditors/Editors/DictionaryEditor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs b/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs index 53e539234..d120b9bc0 100644 --- a/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs +++ b/Source/Editor/CustomEditors/Editors/DictionaryEditor.cs @@ -333,7 +333,7 @@ namespace FlaxEditor.CustomEditors.Editors { foreach (var e in dictionary.Keys) { - if (e == key) + if (Equals(e, key)) continue; newValues[e] = dictionary[e]; } @@ -408,7 +408,7 @@ namespace FlaxEditor.CustomEditors.Editors foreach (var e in newValues.Keys) { var asLong = Convert.ToInt64(e); - if (asLong == uniqueKey) + if (asLong.Equals(uniqueKey)) { uniqueKey++; isUnique = false; @@ -449,7 +449,7 @@ namespace FlaxEditor.CustomEditors.Editors isUnique = true; foreach (var e in newValues.Keys) { - if ((string)e == uniqueKey) + if (string.Equals((string)e, uniqueKey, StringComparison.InvariantCulture)) { uniqueKey += "*"; isUnique = false;