ips_layer: Remove unnecessary explicit std::pair constructor in std::array

Makes the layout of the array consistent, by making all elements match,
instead of special-casing the first one.
This commit is contained in:
Lioncash 2018-10-09 13:42:34 -04:00
parent f7d2889fb4
commit 9ff743bc0a

View file

@ -22,11 +22,19 @@ enum class IPSFileType {
Error, Error,
}; };
constexpr std::array<std::pair<const char*, const char*>, 11> ESCAPE_CHARACTER_MAP{ constexpr std::array<std::pair<const char*, const char*>, 11> ESCAPE_CHARACTER_MAP{{
std::pair{"\\a", "\a"}, {"\\b", "\b"}, {"\\f", "\f"}, {"\\n", "\n"}, {"\\a", "\a"},
{"\\r", "\r"}, {"\\t", "\t"}, {"\\v", "\v"}, {"\\\\", "\\"}, {"\\b", "\b"},
{"\\\'", "\'"}, {"\\\"", "\""}, {"\\\?", "\?"}, {"\\f", "\f"},
}; {"\\n", "\n"},
{"\\r", "\r"},
{"\\t", "\t"},
{"\\v", "\v"},
{"\\\\", "\\"},
{"\\\'", "\'"},
{"\\\"", "\""},
{"\\\?", "\?"},
}};
static IPSFileType IdentifyMagic(const std::vector<u8>& magic) { static IPSFileType IdentifyMagic(const std::vector<u8>& magic) {
if (magic.size() != 5) if (magic.size() != 5)