From a673decc18abed414299a5ed8fe28b9929d2b9f3 Mon Sep 17 00:00:00 2001 From: Peter Ombwa Date: Tue, 17 Oct 2023 14:27:56 -0700 Subject: [PATCH] chore: Use inline httpClient initialization. --- src/lib/Helpers/ParsingHelpers.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/lib/Helpers/ParsingHelpers.cs b/src/lib/Helpers/ParsingHelpers.cs index 4002741..f4f3033 100644 --- a/src/lib/Helpers/ParsingHelpers.cs +++ b/src/lib/Helpers/ParsingHelpers.cs @@ -10,18 +10,13 @@ namespace Microsoft.OpenApi.ApiManifest.Helpers; internal static class ParsingHelpers { - private static readonly Lazy s_httpClient; - - static ParsingHelpers() + private static readonly Lazy s_httpClient = new(() => new HttpClient(new HttpClientHandler() { - s_httpClient = new(() => new HttpClient(new HttpClientHandler() - { - SslProtocols = System.Security.Authentication.SslProtocols.Tls12, - })) - { - Value = { DefaultRequestVersion = HttpVersion.Version20 } - }; - } + SslProtocols = System.Security.Authentication.SslProtocols.Tls12, + })) + { + Value = { DefaultRequestVersion = HttpVersion.Version20 } + }; internal static void ParseMap(JsonElement node, T permissionsDocument, FixedFieldMap handlers) {