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

Add const lvalue ref to container parameters #51156

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

Muller-Castro
Copy link
Contributor

@Muller-Castro Muller-Castro commented Aug 1, 2021

Adds const lvalue reference to the core container types specified in the documentation that are declared in function parameters.

core/*: #86966
editor/*: #88368
modules/*: #88915
platform/*: #88971
servers/*: #88972
scene/*: #88974
others: #88975

@Muller-Castro Muller-Castro requested review from a team as code owners August 1, 2021 20:28
@Calinou Calinou added this to the 4.0 milestone Aug 1, 2021
@Muller-Castro Muller-Castro force-pushed the value2ref branch 3 times, most recently from 690bd67 to b87f72b Compare August 1, 2021 23:44
@Muller-Castro Muller-Castro changed the title [WIP] Add const lvalue ref to container parameters Add const lvalue ref to container parameters Aug 2, 2021
@Muller-Castro Muller-Castro force-pushed the value2ref branch 5 times, most recently from 374e57c to 1c64d04 Compare August 2, 2021 11:49
@reduz
Copy link
Member

reduz commented Jul 30, 2022

This would probably be good to rebase, its a nice clean up.

@YuriSizov YuriSizov modified the milestones: 4.0, 4.x Sep 8, 2022
@YuriSizov
Copy link
Contributor

As mentioned above, needs a rebase, but is a welcome change.

@akien-mga akien-mga removed request for a team January 5, 2024 09:16
@AThousandShips
Copy link
Member

Oh my bad, I think there was some communication mixup here, I meant to do this to the methods you already modified

Would you be able to split this back up? I'd suggest creating a new branch with this state, and then pulling the old version i.e. the commit 9062dee on this branch, and we can do it in two parts?

@AThousandShips
Copy link
Member

If you need help with resetting this please don't hesitate to ask, I'd prefer to merge this with the original set of changes and review the remaining later as it's much larger in scope 🙂

@Muller-Castro
Copy link
Contributor Author

Will it be necessary to create another PR with that old branch? Because the commit doesn't change the engine's behavior and the changes are very simple

@AThousandShips
Copy link
Member

AThousandShips commented Jan 5, 2024

You'd create a new branch from this one, and then reset this one, you can then create a new PR with the larger changes

The changes needs to be reviewed to prevent any issues, it can have messy side effects that can be hard to predict, your current changes aren't trivial and involves copying data in some cases, that'd require a more thorough review

Either this can be merged now with the original changes, or reviewed later with a larger scope, I'm not comfortable merging it without further review in its current state 🙂

Seeing it's almost 500 files it'd take me a very long time to review and I at least can't dedicate that time at the moment, so even with those changes separated off this should really be at least a few different PRs to aid review

@@ -52,11 +52,13 @@ Error ResourceLoader::load_threaded_request(const String &p_path, const String &
return ::ResourceLoader::load_threaded_request(p_path, p_type_hint, p_use_sub_threads, ResourceFormatLoader::CacheMode(p_cache_mode));
}

ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) {
ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, const Array &r_progress) {
Copy link
Member

@AThousandShips AThousandShips Jan 5, 2024

Choose a reason for hiding this comment

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

This, for example, isn't a valid change, the argument is mutated, and should instead be:

Suggested change
ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, const Array &r_progress) {
ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const String &p_path, Array &r_progress) {

So important to get this in a separate thing for cases that aren't obvious or simple

Note that this change happens to still work due to reference counting, but it's not the correct change, and there's a few more at least just by basically looking over a few files, so that needs deeper evaluation

@AThousandShips AThousandShips dismissed their stale review January 5, 2024 15:51

See above, awaiting changes

@Muller-Castro
Copy link
Contributor Author

Muller-Castro commented Jan 5, 2024

I duplicated the branch then rollbacked using this command: git reset --hard 9062dee and then rebased to see if there was any conflict.

Should I pull another request with the remaining changes?

@AThousandShips
Copy link
Member

AThousandShips commented Jan 5, 2024

They should really be split into a few different PRs, separated by part of the engine, like core, scene, modules, etc., over 400 changes aren't easy or manageable to review

Easiest way is to create branches, then using git reset master which doesn't update the files, just the inclusion, then add the individual files to the commit, like git add core/*

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Jan 8, 2024
@akien-mga akien-mga merged commit 91dacb4 into godotengine:master Jan 8, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks for your patience and great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants