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

Pass SettingsHandler buffers by const ref instead of rvalue ref (since the contents are copied either way) #12703

Merged
merged 1 commit into from Apr 13, 2024

Conversation

nlebeck
Copy link
Contributor

@nlebeck nlebeck commented Apr 13, 2024

SettingsHandler::Buffer is a type alias to a std::array of u8. Moving a std::array of primitives doesn't actually avoid any copies, since the elements are stored inline (https://stackoverflow.com/a/28988913). Changing these methods to take a const ref instead of an rvalue ref makes it clear that we are actually copying the arrays.

@jordan-woyak jordan-woyak merged commit 637ae12 into dolphin-emu:master Apr 13, 2024
11 checks passed
@nlebeck nlebeck deleted the settingshandler-nomove-2 branch April 14, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants