From 13a454d603d379d6980d501cf117f5a61264d548 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 16 Jul 2019 04:23:18 -0400 Subject: [PATCH] Common/SettingsHandler: Use fmt for printing out the serial number Same thing, less code. --- Source/Core/Common/SettingsHandler.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/Common/SettingsHandler.cpp b/Source/Core/Common/SettingsHandler.cpp index 49e142daad..e7b3d5d066 100644 --- a/Source/Core/Common/SettingsHandler.cpp +++ b/Source/Core/Common/SettingsHandler.cpp @@ -9,9 +9,10 @@ #include #include #include -#include #include +#include + #include "Common/CommonTypes.h" namespace Common @@ -124,8 +125,6 @@ std::string SettingsHandler::GenerateSerialNumber() // Must be 9 characters at most; otherwise the serial number will be rejected by SDK libraries, // as there is a check to ensure the string length is strictly lower than 10. // 3 for %j, 2 for %H, 2 for %M, 2 for %S. - std::stringstream stream; - stream << std::put_time(std::localtime(&t), "%j%H%M%S"); - return stream.str(); + return fmt::format("{:%j%H%M%S}", *std::localtime(&t)); } } // namespace Common