Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 3, 2021. It is now read-only.

Conversation

@iamcarbon
Copy link
Contributor

  • Update langversion to 8
  • Enable #nullable annotations
  • Use HashCode.Combine
  • Simplify a switch statement with a switch expression
  • Simplify equality
  • Use shared HeaderNames
  • Prefer is null to == null
  • Remove unused using statement
  • Seal classes

@iamcarbon
Copy link
Contributor Author

@damianh Ready for review

private int DefaultPort(string scheme)
{
switch (scheme.ToLower())
return scheme.ToLowerInvariant() switch
Copy link
Contributor

@bartelink bartelink Apr 5, 2020

Choose a reason for hiding this comment

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

should be using String.Equals(...,..., StringComparison.OrdinalIgnoreCase) rather than triggering copying/allocation for no reward
a small local function helper "SchemeIs(value : string)` should leave it pretty comprehensible as an if/else chain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Even better, we can rely on this being lowercase by normalizing the scheme during construction. Uri().Scheme already normalizes for us.

@damianh
Copy link
Collaborator

damianh commented May 1, 2020

Thanks for PR. Will get to look at this in next week or so. IRL so busy atm.

@damianh damianh merged commit 05ff4c4 into ProxyKit:master Sep 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.