Fix removing keys in Dictionary with string keys

This commit is contained in:
Wojtek Figat
2021-11-03 11:51:10 +01:00
parent 254ebd1e7f
commit 2ee835d23b

View File

@@ -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;