Use templates to reduce the redundant number-lexing functions (#1963)

This commit is contained in:
Rangi
2026-05-21 17:13:09 -04:00
committed by GitHub
parent 1871b0a0b8
commit 48fcd9a0ca
8 changed files with 121 additions and 216 deletions
+1 -1
View File
@@ -128,7 +128,7 @@ MbcType mbc_ParseName(char const *name, uint8_t &tpp1Major, uint8_t &tpp1Minor)
}
// Parse numeric MBC and return it as-is (unless it's too large)
if (char c = *ptr; isDigit(c) || c == '$' || c == '&' || c == '%') {
if (char c = *ptr; isDigit<10>(c) || c == '$' || c == '&' || c == '%') {
if (std::optional<uint64_t> mbc = parseWholeNumber(ptr); !mbc) {
fatalUnknownMBC(name);
} else if (*mbc > 0xFF) {