Core/Analytics: Simplify static_assert

We can just use a std::array here to simplify the size calculation.
This commit is contained in:
Lioncash 2019-06-03 19:25:01 -04:00
parent 7935c27b52
commit 2c2b9690bb
1 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,6 @@
#include "Core/Analytics.h" #include "Core/Analytics.h"
#include <array>
#include <cinttypes> #include <cinttypes>
#include <mbedtls/sha1.h> #include <mbedtls/sha1.h>
#include <memory> #include <memory>
@ -138,12 +139,11 @@ void DolphinAnalytics::ReportGameStart()
} }
// Keep in sync with enum class GameQuirk definition. // Keep in sync with enum class GameQuirk definition.
static const char* GAME_QUIRKS_NAMES[] = { constexpr std::array<const char*, 2> GAME_QUIRKS_NAMES{
"icache-matters", "icache-matters",
"directly-reads-wiimote-input", "directly-reads-wiimote-input",
}; };
static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) == static_assert(GAME_QUIRKS_NAMES.size() == static_cast<u32>(GameQuirk::COUNT),
static_cast<u32>(GameQuirk::COUNT),
"Game quirks names and enum definition are out of sync."); "Game quirks names and enum definition are out of sync.");
void DolphinAnalytics::ReportGameQuirk(GameQuirk quirk) void DolphinAnalytics::ReportGameQuirk(GameQuirk quirk)