Codechange: Use fmt::format instead of stringstream with iomanip flags. (#13964)

This commit is contained in:
frosch
2025-04-08 22:57:50 +02:00
committed by GitHub
parent 5b9d171e63
commit 04246c530f
14 changed files with 8 additions and 43 deletions

View File

@@ -11,9 +11,6 @@
#include "../rail_map.h"
#include "dbg_helpers.h"
#include <sstream>
#include <iomanip>
#include "../safeguards.h"
/** Trackdir & TrackdirBits short names. */
@@ -62,10 +59,7 @@ std::string ValueStr(SignalType t)
/** Translate TileIndex into string. */
std::string TileStr(TileIndex tile)
{
std::stringstream ss;
ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << tile.base(); // 0x%04X
ss << " (" << TileX(tile) << ", " << TileY(tile) << ")";
return ss.str();
return fmt::format("0x{:04X} ({}, {})", tile.base(), TileX(tile), TileY(tile));
}
/**