Replace std::ostringstream usage with fmt::format

This commit is contained in:
get
2023-06-17 19:23:49 -05:00
parent 44498872e9
commit ffabb6c57b
6 changed files with 27 additions and 49 deletions

View File

@ -7,6 +7,8 @@
#include <locale>
#include <sstream>
#include <fmt/format.h>
namespace Common::Debug
{
Watch::Watch(u32 address_, std::string name_, State is_enabled_)
@ -107,13 +109,9 @@ void Watches::LoadFromStrings(const std::vector<std::string>& watches)
std::vector<std::string> Watches::SaveToStrings() const
{
std::vector<std::string> watches;
watches.reserve(m_watches.size());
for (const auto& watch : m_watches)
{
std::ostringstream ss;
ss.imbue(std::locale::classic());
ss << std::hex << watch.address << " " << watch.name;
watches.push_back(ss.str());
}
watches.emplace_back(fmt::format("{:x} {}", watch.address, watch.name));
return watches;
}