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

Code style: Use non-static member initialisation instead of member initialiser lists for shader uniform names #14227

Merged
merged 1 commit into from Jan 11, 2024

Conversation

HybridDog
Copy link
Contributor

Before this change, the member type and member name are at one place, and the member name and uniform name are at another place.
If the uniform name is written directly at the member declaration, the member type, member name and uniform name are all at one place, which leads to shorter code and may be easier to read.

According to the code style guidelines, initializer lists should only be used when absolutely necessary, but I don't know if that is about std::initializer_list or member initialiser lists.

Roadmap goal: 2.2 Internal code refactoring

To do

This PR is a Ready for Review.

How to test

Read the code before and after the changes

…itialiser lists for shader uniform names

Before this change,
the member type and member name are at one place,
and the member name and uniform name are at another place.
If the uniform name is written directly at the member declaration,
the member type, member name and uniform name are all at one place,
which leads to shorter code and may be easier to read.
@wsor4035 wsor4035 added Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements Code quality labels Jan 7, 2024
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

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

btw I think the {} initialization is the ugliest C++ syntax to ever exist.

@appgurueu appgurueu merged commit 345e93d into minetest:master Jan 11, 2024
13 checks passed
@HybridDog HybridDog deleted the m_style_no_member_init_list branch January 12, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code quality Maintenance Tasks to keep the codebase and related parts in order, including architectural improvements >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants