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

IAttribute and ICharTermAttribute method changes, #1038 #1049

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

paulirwin
Copy link
Contributor

@paulirwin paulirwin commented Nov 26, 2024

  • 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.

Remove SetLength and SetEmpty from ICharTermAttribute and moves them to extension methods. Add Clear() in place of SetEmpty.

Fixes #1038

Description

See the rationale in #1038.

This PR makes the following breaking changes:

  • Removes SetLength and SetEmpty from ICharTermAttribute, moves them to extensions instead.
  • Adds the Clear method to ICharTermAttribute.
  • Removes the CopyTo method from IAttribute.

@paulirwin paulirwin added the notes:breaking-change Has changes that will break backward compatibility label Nov 26, 2024
Copy link
Contributor

@NightOwl888 NightOwl888 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

Looks good except it is missing the implementation of the SetLength() extension method and SetLength() hasn't been removed from CharTermAttribute. See the inline comments.

@paulirwin paulirwin changed the title Remove SetLength from ICharTermAttribute, #1038 Remove SetLength and SetEmpty from ICharTermAttribute, #1038 Nov 26, 2024
Copy link
Contributor

@NightOwl888 NightOwl888 left a comment

Choose a reason for hiding this comment

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

I agree. Putting the Clear() method on ICharTermAttribute seems to be the best solution.

However, there is some cleanup left to do. Please see the inline comments.

@paulirwin paulirwin changed the title Remove SetLength and SetEmpty from ICharTermAttribute, #1038 IAttribute and ICharTermAttribute method changes, #1038 Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes:breaking-change Has changes that will break backward compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove SetLength and SetEmpty from ICharTermAttribute
2 participants