From 33bf1f9653ed608de5554940dc8a0c3f5dc7e4ea Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 10 Jun 2024 19:13:22 -0400 Subject: Go back to old logging system Brought in libfmt to handle string formatting and replace a bunch of ostringstream uses. --- src/subway_map.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/subway_map.cpp') diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 5c99567..c7b2c8a 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp @@ -3,6 +3,7 @@ #include #include +#include #include #include "ap_state.h" @@ -85,10 +86,8 @@ void SubwayMap::OnConnect() { if (!AP_IsSunwarpShuffle() && subway_item.sunwarp && subway_item.sunwarp->type != SubwaySunwarpType::kFinal) { - std::ostringstream tag; - tag << "sunwarp" << subway_item.sunwarp->dots; - - tagged[tag.str()].push_back(subway_item.id); + std::string tag = fmt::format("subway{}", subway_item.sunwarp->dots); + tagged[tag].push_back(subway_item.id); } if (!AP_IsPilgrimageEnabled() && @@ -100,8 +99,7 @@ void SubwayMap::OnConnect() { if (AP_IsSunwarpShuffle()) { for (const auto &[index, mapping] : AP_GetSunwarpMapping()) { - std::ostringstream tag; - tag << "sunwarp" << mapping.dots; + std::string tag = fmt::format("sunwarp{}", mapping.dots); SubwaySunwarp fromWarp; if (index < 6) { @@ -121,8 +119,8 @@ void SubwayMap::OnConnect() { toWarp.type = SubwaySunwarpType::kExit; } - tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(fromWarp)); - tagged[tag.str()].push_back(GD_GetSubwayItemForSunwarp(toWarp)); + tagged[tag].push_back(GD_GetSubwayItemForSunwarp(fromWarp)); + tagged[tag].push_back(GD_GetSubwayItemForSunwarp(toWarp)); } } -- cgit 1.4.1