diff --git a/src/RestSharp/SimpleClientFactory.cs b/src/RestSharp/SimpleClientFactory.cs index 46f5d6273..eb28780e2 100644 --- a/src/RestSharp/SimpleClientFactory.cs +++ b/src/RestSharp/SimpleClientFactory.cs @@ -22,9 +22,6 @@ static class SimpleClientFactory { public static HttpClient GetClient(Uri baseUrl, Func getClient) { var key = baseUrl.ToString(); - if (CachedClients.TryGetValue(key, out var client)) return client; - client = getClient(); - CachedClients.TryAdd(key, client); - return client; + return CachedClients.GetOrAdd(key, key => getClient()); } }