diff --git a/src/Models/User.cs b/src/Models/User.cs index 2ef770cf..ba1bebd6 100644 --- a/src/Models/User.cs +++ b/src/Models/User.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Concurrent; namespace SourceGit.Models { @@ -36,11 +36,11 @@ namespace SourceGit.Models var email = data.Substring(nameEndIdx + 1); User user = new User() { Name = name, Email = email }; - _caches.Add(data, user); + _caches.TryAdd(data, user); return user; } } - private static Dictionary _caches = new Dictionary(); + private static ConcurrentDictionary _caches = new ConcurrentDictionary(); } }