From c8a99e580683b6d9d999d066d56cceeac301c091 Mon Sep 17 00:00:00 2001 From: Damir Ainullin Date: Mon, 28 Aug 2017 20:12:27 +0300 Subject: [PATCH] Removed redundant if checks (#1390) --- .../AuthenticationHandler.cs | 2 +- test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs b/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs index d1d09f0746..812ba2f1a8 100644 --- a/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs +++ b/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.Authentication Logger.AuthenticationSchemeNotAuthenticated(Scheme.Name); } } - else if (result?.Failure != null) + else { Logger.AuthenticationSchemeNotAuthenticatedWithFailure(Scheme.Name, result.Failure.Message); } diff --git a/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs index d346c68d7f..789f5ede9c 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/CookieTests.cs @@ -1325,11 +1325,11 @@ namespace Microsoft.AspNetCore.Authentication.Cookies res.StatusCode = 200; res.ContentType = "text/xml"; var xml = new XElement("xml"); - if (result != null && result?.Ticket?.Principal != null) + if (result?.Ticket?.Principal != null) { xml.Add(result.Ticket.Principal.Claims.Select(claim => new XElement("claim", new XAttribute("type", claim.Type), new XAttribute("value", claim.Value)))); } - if (result != null && result?.Ticket?.Properties != null) + if (result?.Ticket?.Properties != null) { xml.Add(result.Ticket.Properties.Items.Select(extra => new XElement("extra", new XAttribute("type", extra.Key), new XAttribute("value", extra.Value)))); }