Task type
Development
Description
ConcurrentHashSet (in src/client/Microsoft.Identity.Client/Utils/ConcurrentHashSet.cs) is copied from i3arnon/ConcurrentHashSet (https://github.com/i3arnon/ConcurrentHashSet) and carries ~400 lines of custom concurrent collection code that we maintain but don't own.
.NET provides ConcurrentDictionary<TKey, TValue> which can serve as a thread-safe set using ConcurrentDictionary<T, byte> with a dummy value.
Current usage — only one place:
- AuthorityManager.s_validatedEnvironments (src/client/Microsoft.Identity.Client/Instance/AuthorityManager.cs:20)
Solution
- Replace ConcurrentHashSet with ConcurrentDictionary<string, byte> in AuthorityManager
- Map API calls: Add() → TryAdd(key, 0), Contains() → ContainsKey()
- Delete ConcurrentHashSet.cs (~400 lines)
Task type
Development
Description
ConcurrentHashSet (in src/client/Microsoft.Identity.Client/Utils/ConcurrentHashSet.cs) is copied from i3arnon/ConcurrentHashSet (https://github.com/i3arnon/ConcurrentHashSet) and carries ~400 lines of custom concurrent collection code that we maintain but don't own.
.NET provides ConcurrentDictionary<TKey, TValue> which can serve as a thread-safe set using ConcurrentDictionary<T, byte> with a dummy value.
Current usage — only one place:
Solution