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

Refactor RegistryKeyList #264

Merged
merged 1 commit into from
Jan 21, 2013
Merged

Refactor RegistryKeyList #264

merged 1 commit into from
Jan 21, 2013

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jan 16, 2013

This is in preparation for page patching. The old code kept dynamic (programatically created) and serialized keys separate. This had the potential to reorder the key list during the application of a patch.

This is separate from the prp-patches branch to facillitate review.

@Hoikas
Copy link
Member Author

Hoikas commented Jan 18, 2013

Updated with a few small fixes

}
}
auto it = std::find_if(fKeys.begin(), fKeys.end(),
[&] (plKeyImp* key) { return key->GetName().CompareI(keyName) == 0; }
Copy link
Member

Choose a reason for hiding this comment

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

Personally, I like to avoid the "capture everything" forms in lambdas... You need keyName, so just capture [&keyName] >.>

Copy link
Member Author

Choose a reason for hiding this comment

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

Whereas I prefer to capture everything and let the compiler figure it out 😄. I feel that explicit capture list are somewhat redundant/tedious and have the potential to introduce stupid compiler errors (if you forget to change the capture list when updating the lambda body). If we have a consensus that explicit capturing is better, I'd be glad to change it though.

Copy link
Member

Choose a reason for hiding this comment

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

For lambdas that are used inline like this, and that we know are not going to be saved and called later, I think the implicit "capture it all by reference" usage is fine.

This is in preparation for page patching. The old code kept dynamic
(programatically created) and serialized keys separate. This had the
potential to reorder the key list during the application of a patch.

This is separate from the prp-patches branch to facillitate review.
branan pushed a commit that referenced this pull request Jan 21, 2013
Refactor RegistryKeyList
@branan branan merged commit 7041aef into H-uru:master Jan 21, 2013
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