From 59ed08b924f4166ab45eda7d85e8bd9fe0f5e553 Mon Sep 17 00:00:00 2001 From: DeaTh-G Date: Thu, 20 Feb 2025 15:25:58 +0100 Subject: [PATCH] remove usage of temporaries --- UnleashedRecomp/ui/imgui_utils.cpp | 2 +- UnleashedRecomp/ui/installer_wizard.cpp | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index 7323c9c4..be085b4c 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -682,7 +682,7 @@ void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, c line = ReAddRubyAnnotations(line, input.second); if (!line.empty() && line.substr(0, 3) != "「" && leadingSpace) { - line = " " + line; + line.insert(0, " "); } } diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index 8da2d65b..243f21bf 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -741,12 +741,10 @@ static void DrawDescriptionContainer() // special characters. if (Config::Language == ELanguage::Japanese) { - strncat(descriptionText, std::string(" " + g_installerErrorMessage).c_str(), sizeof(descriptionText) - 1); - } - else - { - strncat(descriptionText, g_installerErrorMessage.c_str(), sizeof(descriptionText) - 1); + strncat(descriptionText, " ", 1); } + + strncat(descriptionText, g_installerErrorMessage.c_str(), sizeof(descriptionText) - 1); } double textAlpha = ComputeMotionInstaller(g_appearTime, g_disappearTime, CONTAINER_INNER_TIME, CONTAINER_INNER_DURATION);