From 51b561907962906ce916708feba8226665d33d7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Sep 2018 05:30:09 -0400 Subject: game_list_p: Take map iterator contents by const reference We don't need to copy the whole struct in this instance, we can just utilize a reference instead. --- src/yuzu/game_list_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index f22e422e5..094437090 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -128,7 +128,7 @@ public: LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); return; } - CompatStatus status = iterator->second; + const CompatStatus& status = iterator->second; setData(compatiblity, CompatNumberRole); setText(QObject::tr(status.text)); setToolTip(QObject::tr(status.tooltip)); -- cgit v1.2.3 From 13930f0c338c78623d9b71770984e9d08befaace Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 17 Sep 2018 05:31:27 -0400 Subject: game_list_p: Amend typo in GameListItemCompat's constructor parameter Adds a missing 'i' character that was missing in compatibility. --- src/yuzu/game_list_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 094437090..b6272d536 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h @@ -106,7 +106,7 @@ class GameListItemCompat : public GameListItem { public: static const int CompatNumberRole = Qt::UserRole + 1; GameListItemCompat() = default; - explicit GameListItemCompat(const QString& compatiblity) { + explicit GameListItemCompat(const QString& compatibility) { struct CompatStatus { QString color; const char* text; @@ -123,13 +123,13 @@ public: {"99", {"#000000", QT_TR_NOOP("Not Tested"), QT_TR_NOOP("The game has not yet been tested.")}}}; // clang-format on - auto iterator = status_data.find(compatiblity); + auto iterator = status_data.find(compatibility); if (iterator == status_data.end()) { - LOG_WARNING(Frontend, "Invalid compatibility number {}", compatiblity.toStdString()); + LOG_WARNING(Frontend, "Invalid compatibility number {}", compatibility.toStdString()); return; } const CompatStatus& status = iterator->second; - setData(compatiblity, CompatNumberRole); + setData(compatibility, CompatNumberRole); setText(QObject::tr(status.text)); setToolTip(QObject::tr(status.tooltip)); setData(CreateCirclePixmapFromColor(status.color), Qt::DecorationRole); -- cgit v1.2.3