We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8dece74 commit 84db183Copy full SHA for 84db183
src/RestSharp/SimpleClientFactory.cs
@@ -22,9 +22,6 @@ static class SimpleClientFactory {
22
23
public static HttpClient GetClient(Uri baseUrl, Func<HttpClient> getClient) {
24
var key = baseUrl.ToString();
25
- if (CachedClients.TryGetValue(key, out var client)) return client;
26
- client = getClient();
27
- CachedClients.TryAdd(key, client);
28
- return client;
+ return CachedClients.GetOrAdd(key, key => getClient());
29
}
30
0 commit comments