diff options
| author | 2014-12-19 18:37:14 +0100 | |
|---|---|---|
| committer | 2014-12-20 18:05:52 +0100 | |
| commit | 8cd0d9c000e2c3cb072ca001db13f1c12f2a07ea (patch) | |
| tree | a63fa5e7d4fb57465e07a9d31bcec2506f7e5e21 | |
| parent | Merge pull request #315 from chinhodado/master (diff) | |
| download | yuzu-8cd0d9c000e2c3cb072ca001db13f1c12f2a07ea.tar.gz yuzu-8cd0d9c000e2c3cb072ca001db13f1c12f2a07ea.tar.xz yuzu-8cd0d9c000e2c3cb072ca001db13f1c12f2a07ea.zip | |
citra-qt: static-constify a map.
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/debugger/graphics_breakpoints.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index 53394b6e6..469c3e268 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp | |||
| @@ -39,15 +39,16 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const | |||
| 39 | switch (index.column()) { | 39 | switch (index.column()) { |
| 40 | case 0: | 40 | case 0: |
| 41 | { | 41 | { |
| 42 | std::map<Pica::DebugContext::Event, QString> map; | 42 | static const std::map<Pica::DebugContext::Event, QString> map = { |
| 43 | map.insert({Pica::DebugContext::Event::CommandLoaded, tr("Pica command loaded")}); | 43 | { Pica::DebugContext::Event::CommandLoaded, tr("Pica command loaded") }, |
| 44 | map.insert({Pica::DebugContext::Event::CommandProcessed, tr("Pica command processed")}); | 44 | { Pica::DebugContext::Event::CommandProcessed, tr("Pica command processed") }, |
| 45 | map.insert({Pica::DebugContext::Event::IncomingPrimitiveBatch, tr("Incoming primitive batch")}); | 45 | { Pica::DebugContext::Event::IncomingPrimitiveBatch, tr("Incoming primitive batch") }, |
| 46 | map.insert({Pica::DebugContext::Event::FinishedPrimitiveBatch, tr("Finished primitive batch")}); | 46 | { Pica::DebugContext::Event::FinishedPrimitiveBatch, tr("Finished primitive batch") }, |
| 47 | }; | ||
| 47 | 48 | ||
| 48 | _dbg_assert_(Debug_GPU, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); | 49 | _dbg_assert_(Debug_GPU, map.size() == static_cast<size_t>(Pica::DebugContext::Event::NumEvents)); |
| 49 | 50 | ||
| 50 | return map[event]; | 51 | return (map.find(event) != map.end()) ? map.at(event) : QString(); |
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | case 1: | 54 | case 1: |