mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Rearrange switches so default cases are last
This commit is contained in:
@@ -1257,14 +1257,6 @@ static void appendEscapedString(std::string &str, std::string const &escape) {
|
||||
for (char c : escape) {
|
||||
// Escape characters that need escaping
|
||||
switch (c) {
|
||||
case '\\':
|
||||
case '"':
|
||||
case '{':
|
||||
str += '\\';
|
||||
[[fallthrough]];
|
||||
default:
|
||||
str += c;
|
||||
break;
|
||||
case '\n':
|
||||
str += "\\n";
|
||||
break;
|
||||
@@ -1277,6 +1269,14 @@ static void appendEscapedString(std::string &str, std::string const &escape) {
|
||||
case '\0':
|
||||
str += "\\0";
|
||||
break;
|
||||
case '\\':
|
||||
case '"':
|
||||
case '{':
|
||||
str += '\\';
|
||||
[[fallthrough]];
|
||||
default:
|
||||
str += c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user