summaryrefslogtreecommitdiff
path: root/src/input_common/drivers/tas_input.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2021-12-13 11:36:48 -0500
committerGravatar Lioncash2021-12-13 11:45:19 -0500
commit54ca48e8b772453814d2e4d49a4ba29a1b46b32d (patch)
treeb8dae22038a45e49c8e318a8991e2f6e89ad752c /src/input_common/drivers/tas_input.cpp
parenttas_input: Remove unnecessary semicolon (diff)
downloadyuzu-54ca48e8b772453814d2e4d49a4ba29a1b46b32d.tar.gz
yuzu-54ca48e8b772453814d2e4d49a4ba29a1b46b32d.tar.xz
yuzu-54ca48e8b772453814d2e4d49a4ba29a1b46b32d.zip
tas_input: Avoid minor copies in Read/WriteCommandButtons()
We don't need to copy the whole pair
Diffstat (limited to 'src/input_common/drivers/tas_input.cpp')
-rw-r--r--src/input_common/drivers/tas_input.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index 1617ba1d4..2094c1feb 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -244,7 +244,7 @@ u64 Tas::ReadCommandButtons(const std::string& line) const {
244 std::string button_line; 244 std::string button_line;
245 u64 buttons = 0; 245 u64 buttons = 0;
246 while (std::getline(button_text, button_line, ';')) { 246 while (std::getline(button_text, button_line, ';')) {
247 for (auto [text, tas_button] : text_to_tas_button) { 247 for (const auto& [text, tas_button] : text_to_tas_button) {
248 if (text == button_line) { 248 if (text == button_line) {
249 buttons |= static_cast<u64>(tas_button); 249 buttons |= static_cast<u64>(tas_button);
250 break; 250 break;
@@ -256,7 +256,7 @@ u64 Tas::ReadCommandButtons(const std::string& line) const {
256 256
257std::string Tas::WriteCommandButtons(u64 buttons) const { 257std::string Tas::WriteCommandButtons(u64 buttons) const {
258 std::string returns; 258 std::string returns;
259 for (auto [text_button, tas_button] : text_to_tas_button) { 259 for (const auto& [text_button, tas_button] : text_to_tas_button) {
260 if ((buttons & static_cast<u64>(tas_button)) != 0) { 260 if ((buttons & static_cast<u64>(tas_button)) != 0) {
261 returns += fmt::format("{};", text_button); 261 returns += fmt::format("{};", text_button);
262 } 262 }