summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug/Watches.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2023-06-19 02:18:30 +0200
committerGitHub <noreply@github.com>2023-06-19 02:18:30 +0200
commit5d7b5822c97285a1b45f54b2ae8046808cbe54d2 (patch)
tree341d0c17ea3ea9e364cac57ebb1b86270e904528 /Source/Core/Common/Debug/Watches.cpp
parent9e06b6964b04829d526609b3cf98bca58f80c318 (diff)
parentffabb6c57b59c6ceafd154681c2cde1bd1a65904 (diff)
Merge pull request #11972 from Minty-Meeo/string-improvements-part-1c
Replace std::ostringstream usage with fmt::format
Diffstat (limited to 'Source/Core/Common/Debug/Watches.cpp')
-rw-r--r--Source/Core/Common/Debug/Watches.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/Core/Common/Debug/Watches.cpp b/Source/Core/Common/Debug/Watches.cpp
index dddb3f3435..c476665a41 100644
--- a/Source/Core/Common/Debug/Watches.cpp
+++ b/Source/Core/Common/Debug/Watches.cpp
@@ -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;
}