From 82050b8d5a85feaca675cc67837a386cbaa9ca78 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Tue, 11 Apr 2023 00:26:46 +0200 Subject: [PATCH] Fixed some code issues --- RGB.NET.Core/Ids/IdGenerator.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RGB.NET.Core/Ids/IdGenerator.cs b/RGB.NET.Core/Ids/IdGenerator.cs index 99beaa6..c6270e7 100644 --- a/RGB.NET.Core/Ids/IdGenerator.cs +++ b/RGB.NET.Core/Ids/IdGenerator.cs @@ -50,8 +50,7 @@ public static class IdGenerator idMapping.Add(id, mappedId); } - if (!counterMapping.ContainsKey(mappedId)) - counterMapping.Add(mappedId, 0); + counterMapping.TryAdd(mappedId, 0); int counter = ++counterMapping[mappedId]; return counter <= 1 ? mappedId : $"{mappedId} ({counter})";