Skip to content

Two minor perf tweaks in CORS and Localization middleware #23190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2020

Conversation

martincostello
Copy link
Member

  • Use the newer overload for string.Split() that accepts a char instead of creating a char[].
  • Remove redundant bounds checks for count of exactly 1 as they have already been checked.

Use the newer overload for string.Split() that accepts a char instead of creating a char array.
Remove redundant bounds check for count of exactly 1 as that has already been checked to be true by the previous check.
@martincostello martincostello requested a review from Tratcher as a code owner June 20, 2020 17:26
@ghost ghost added the area-middleware label Jun 20, 2020
@@ -60,9 +59,7 @@ public static string MakeCookieValue(RequestCulture requestCulture)
throw new ArgumentNullException(nameof(requestCulture));
}

var seperator = _cookieSeparator[0].ToString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

@pranavkm pranavkm merged commit 5155e11 into dotnet:master Jun 24, 2020
@pranavkm pranavkm added this to the 5.0.0-preview8 milestone Jun 24, 2020
@pranavkm
Copy link
Contributor

Thanks!

@martincostello martincostello deleted the Minor-Perf branch June 24, 2020 14:18
@amcasey amcasey added the area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants