Skip to content

Use new string.Split() overloads#23683

Merged
Tratcher merged 2 commits intodotnet:masterfrom
martincostello:Use-New-Split-Overloads
Jul 5, 2020
Merged

Use new string.Split() overloads#23683
Tratcher merged 2 commits intodotnet:masterfrom
martincostello:Use-New-Split-Overloads

Conversation

@martincostello
Copy link
Member

  • Use new string.Split() overloads to remove need to allocate arrays.
  • Use static array for new line characters in HtmlEncodeAndReplaceLineBreaks() instead of allocating a new one each time.

Use new Split() overloads to remove need to allocate arrays.
Use static array for new line chars instead of allocating a new one each time.
@martincostello martincostello requested a review from Tratcher as a code owner July 5, 2020 16:19
@Tratcher Tratcher merged commit 4b3fcaf into dotnet:master Jul 5, 2020
@Tratcher
Copy link
Member

Tratcher commented Jul 5, 2020

Thanks

@Tratcher Tratcher added this to the 5.0.0-preview8 milestone Jul 5, 2020
@martincostello martincostello deleted the Use-New-Split-Overloads branch July 5, 2020 20:18
@GrabYourPitchforks
Copy link
Member

Related: You should also take a look at dotnet/runtime#35740 and GrabYourPitchforks@bbf393f if you're trying to clean up these code paths a bit.

@martincostello
Copy link
Member Author

Ah nice, I wasn't aware of that incoming. Looks like one of these changes could be refactored to use the new enum member.

@martincostello
Copy link
Member Author

Ah wait, I noticed you already did it in the referenced commit 😃

@GrabYourPitchforks
Copy link
Member

Yup. Feel free to send a new PR and improve upon it however you see fit.

@martincostello
Copy link
Member Author

Yup. Feel free to send a new PR and improve upon it however you see fit.

Done - #23712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants