From 20ed5be9051d6dcaf9ba882f60b316c81354d2e5 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 27 Jun 2025 21:38:39 +0100 Subject: [PATCH] Codechange: Use FontSizeToName() instead of switch block. (#14395) --- src/strings.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/strings.cpp b/src/strings.cpp index cd77c85540..e67a6ac81b 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2269,17 +2269,7 @@ bool MissingGlyphSearcher::FindMissingGlyphs() fc = FontCache::Get(size); } else if (!IsInsideMM(c, SCC_SPRITE_START, SCC_SPRITE_END) && IsPrintable(c) && !IsTextDirectionChar(c) && fc->MapCharToGlyph(c, false) == 0) { /* The character is printable, but not in the normal font. This is the case we were testing for. */ - std::string size_name; - - switch (size) { - case FS_NORMAL: size_name = "medium"; break; - case FS_SMALL: size_name = "small"; break; - case FS_LARGE: size_name = "large"; break; - case FS_MONO: size_name = "mono"; break; - default: NOT_REACHED(); - } - - Debug(fontcache, 0, "Font is missing glyphs to display char 0x{:X} in {} font size", (int)c, size_name); + Debug(fontcache, 0, "Font is missing glyphs to display char 0x{:X} in {} font size", static_cast(c), FontSizeToName(size)); return true; } }