Skip to content

Use J2N methods instead of StringBuilder.Remove, #664#1132

Draft
paulirwin wants to merge 1 commit into
apache:masterfrom
paulirwin:issue/664
Draft

Use J2N methods instead of StringBuilder.Remove, #664#1132
paulirwin wants to merge 1 commit into
apache:masterfrom
paulirwin:issue/664

Conversation

@paulirwin

Copy link
Copy Markdown
Contributor
  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Use J2N methods instead of StringBuilder.Remove

Fixes #664

Description

See #664 for details. In one case, the Remove/Insert was not able to be replaced with Replace and that was noted with a comment. Also, use of the pattern sb.Remove(0, sb.Length) was replaced with sb.Clear() instead of sb.Delete(0, sb.Length), as it is more semantically understandable, less prone to mistakes, and has a few less checks internally than Delete cascading to Remove so it should be a little more efficient.

@paulirwin paulirwin added the notes:improvement An enhancement to an existing feature label Mar 3, 2025
@paulirwin paulirwin requested a review from NightOwl888 March 3, 2025 04:50
@paulirwin paulirwin marked this pull request as draft March 4, 2025 16:24
@paulirwin

Copy link
Copy Markdown
Contributor Author

Converted to draft until OpenStringBuilder is in place

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

Labels

notes:improvement An enhancement to an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change StringBuilder.Remove to J2N appropiate methods

1 participant