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

Simplify MakePrintable by using AND and avoiding converting to string #2101

Merged
merged 5 commits into from Oct 21, 2022
Merged

Simplify MakePrintable by using AND and avoiding converting to string #2101

merged 5 commits into from Oct 21, 2022

Conversation

pavkam
Copy link
Contributor

@pavkam pavkam commented Oct 19, 2022

This PR simplifies MakePrintable by using simpler bitwise OR instead of string manipulation.

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

Can you please provide a unit test that helps ensure this won't cause a regression?

I really appreciate your attention to detail and am excited to have you helping!

@pavkam
Copy link
Contributor Author

pavkam commented Oct 19, 2022

@tig -- added two parameterized tests

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

Before I accept this, I'd like confirmation that this change has been thoroughly tested on Windows, Linux, and the Mac.

I don't fully understand the code paths/scenarios involved where this method is used and am nervous about introducing a regression in an area where we have really poor unit testing (all drivers).

@pavkam
Copy link
Contributor Author

pavkam commented Oct 20, 2022

Before I accept this, I'd like confirmation that this change has been thoroughly tested on Windows, Linux, and the Mac.

I don't fully understand the code paths/scenarios involved where this method is used and am nervous about introducing a regression in an area where we have really poor unit testing (all drivers).

It's a straightforward method. Unit tests cover all scenarios that would be there.

I don't think deeper testing is needed for this particular change.

@BDisp
Copy link
Collaborator

BDisp commented Oct 20, 2022

Before I accept this, I'd like confirmation that this change has been thoroughly tested on Windows, Linux, and the Mac.

I don't fully understand the code paths/scenarios involved where this method is used and am nervous about introducing a regression in an area where we have really poor unit testing (all drivers).

I confirm that the method is common for all drivers and this is a short way to get the hexadecimal from the rune which is well written. Thanks @pavkam.

@tig tig merged commit 9e5137f into gui-cs:develop Oct 21, 2022
This was referenced Nov 4, 2022
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.

None yet

3 participants