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

Convert static const to constexpr #11534

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

Conversation

HTRamsey
Copy link
Collaborator

This is a cleanup/optimization mostly of jsonkeys using constexpr

@HTRamsey HTRamsey requested a review from mrpollo May 14, 2024 18:48
@HTRamsey HTRamsey changed the title Convert const statics to constexpr Convert static const to constexpr May 14, 2024
@mrpollo
Copy link
Member

mrpollo commented May 16, 2024

Hey @HTRamsey I'm a bit scared out of this seemingly safe optimization, I'm wondering if there's anything our test coverage might miss here.

Is this ready for final review?

@HTRamsey
Copy link
Collaborator Author

HTRamsey commented May 16, 2024

Most likely the compiler already does this, but at least this cuts the code lines in half. The only thing I wasn't sure of entirely was how it would work work with transations for those variables that have QT_TRANSLATE_NOOP, but it doesn't appear to be an issue.

And speaking of test coverage, that's one thing I also think needs to be greatly expanded. Which is why separating out smaller modules makes it easier to test individual functionality. I've added some tests, but not many.

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

2 participants