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

View file

@ -1,5 +1,6 @@
#include "Core/Analytics.h"
#include <array>
#include <cinttypes>
#include <mbedtls/sha1.h>
#include <memory>
@ -138,12 +139,11 @@ void DolphinAnalytics::ReportGameStart()
}
// 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",
"directly-reads-wiimote-input",
};
static_assert(sizeof(GAME_QUIRKS_NAMES) / sizeof(GAME_QUIRKS_NAMES[0]) ==
static_cast<u32>(GameQuirk::COUNT),
static_assert(GAME_QUIRKS_NAMES.size() == static_cast<u32>(GameQuirk::COUNT),
"Game quirks names and enum definition are out of sync.");
void DolphinAnalytics::ReportGameQuirk(GameQuirk quirk)