input_common/main: Pass MappingData by const reference in callbacks
Avoids creating unnecessary 168 byte copies per callback invocation.
This commit is contained in:
parent
4a497fc961
commit
1bd76dcb77
2 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ namespace InputCommon {
|
|||
struct InputSubsystem::Impl {
|
||||
void Initialize() {
|
||||
mapping_factory = std::make_shared<MappingFactory>();
|
||||
MappingCallback mapping_callback{[this](MappingData data) { RegisterInput(data); }};
|
||||
MappingCallback mapping_callback{[this](const MappingData& data) { RegisterInput(data); }};
|
||||
|
||||
keyboard = std::make_shared<Keyboard>("keyboard");
|
||||
keyboard->SetMappingCallback(mapping_callback);
|
||||
|
@ -284,7 +284,7 @@ struct InputSubsystem::Impl {
|
|||
#endif
|
||||
}
|
||||
|
||||
void RegisterInput(MappingData data) {
|
||||
void RegisterInput(const MappingData& data) {
|
||||
mapping_factory->RegisterInput(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue