Skip to content
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

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulirwin
Copy link
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
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