Merge pull request #17846 from Kahbazi/kahbazi/localization

Skip culture check when unnecessary
This commit is contained in:
Ryan Brandenburg 2019-12-26 14:27:53 -08:00 committed by GitHub
commit d5cc8cbad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 10 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved. // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
@ -59,8 +59,7 @@ namespace Microsoft.AspNetCore.Localization.Routing
// Value for culture but not for UI culture so default to culture value for both // Value for culture but not for UI culture so default to culture value for both
uiCulture = culture; uiCulture = culture;
} }
else if (culture == null && uiCulture != null)
if (culture == null && uiCulture != null)
{ {
// Value for UI culture but not for culture so default to UI culture value for both // Value for UI culture but not for culture so default to UI culture value for both
culture = uiCulture; culture = uiCulture;

View File

@ -109,8 +109,7 @@ namespace Microsoft.AspNetCore.Localization
// Value for culture but not for UI culture so default to culture value for both // Value for culture but not for UI culture so default to culture value for both
uiCultureName = cultureName; uiCultureName = cultureName;
} }
else if (cultureName == null && uiCultureName != null)
if (cultureName == null && uiCultureName != null)
{ {
// Value for UI culture but not for culture so default to UI culture value for both // Value for UI culture but not for culture so default to UI culture value for both
cultureName = uiCultureName; cultureName = uiCultureName;

View File

@ -64,8 +64,7 @@ namespace Microsoft.AspNetCore.Localization
// Value for culture but not for UI culture so default to culture value for both // Value for culture but not for UI culture so default to culture value for both
queryUICulture = queryCulture; queryUICulture = queryCulture;
} }
else if (queryCulture == null && queryUICulture != null)
if (queryCulture == null && queryUICulture != null)
{ {
// Value for UI culture but not for culture so default to UI culture value for both // Value for UI culture but not for culture so default to UI culture value for both
queryCulture = queryUICulture; queryCulture = queryUICulture;

View File

@ -126,8 +126,7 @@ namespace Microsoft.AspNetCore.Localization
{ {
cultureInfo = _options.DefaultRequestCulture.Culture; cultureInfo = _options.DefaultRequestCulture.Culture;
} }
else if (cultureInfo != null && uiCultureInfo == null)
if (cultureInfo != null && uiCultureInfo == null)
{ {
uiCultureInfo = _options.DefaultRequestCulture.UICulture; uiCultureInfo = _options.DefaultRequestCulture.UICulture;
} }