Skip to content
Snippets Groups Projects
Commit 9ff743bc authored by Lioncash's avatar Lioncash
Browse files

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.
parent f7d2889f
No related branches found
No related tags found
No related merge requests found
...@@ -22,11 +22,19 @@ enum class IPSFileType { ...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment