1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 20:54:08 +01:00

Codechange: Add format_append as short-hand to format_to + back_inserter.

This commit is contained in:
frosch
2025-04-29 12:37:34 +02:00
committed by frosch
parent 98481ecc01
commit fda93b6f35
12 changed files with 32 additions and 27 deletions

View File

@@ -152,7 +152,7 @@ static std::string_view MakeScreenshotName(std::string_view default_fn, std::str
size_t len = _screenshot_name.size();
/* Add extension to screenshot file */
_screenshot_name += fmt::format(".{}", ext);
format_append(_screenshot_name, ".{}", ext);
std::string_view screenshot_dir = crashlog ? _personal_dir : FiosGetScreenshotDir();
@@ -163,7 +163,7 @@ static std::string_view MakeScreenshotName(std::string_view default_fn, std::str
if (!FileExists(_full_screenshot_path)) break;
/* If file exists try another one with same name, but just with a higher index */
_screenshot_name.erase(len);
_screenshot_name += fmt::format("#{}.{}", serial, ext);
format_append(_screenshot_name, "#{}.{}", serial, ext);
}
return _full_screenshot_path;