-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
PPUAnalyser: fix std::move misuse #14011
Conversation
@@ -1539,7 +1543,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b | |||
end = 0; | |||
} | |||
|
|||
for (auto&& [_, func] : as_rvalue(std::move(fmap))) |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
rpcs3/Emu/Cell/PPUAnalyser.cpp
Outdated
@@ -665,8 +665,8 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b | |||
break; | |||
} | |||
|
|||
const u32 addr = ptr[0]; | |||
const u32 _toc = ptr[1]; | |||
const u32& addr = ptr[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk, from experience const ref is faster even for simple types.
Or can it change here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References should be avoided as it's fragile. It may not always result in reference binding. For instance it's not even obvious what it does here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There seems to be an unwanted - or at least mishandled - std::move of the ppu function map in ppu_module::analyse.
The object is used later again, so this seems like a bug to me.