From fe8849496689934c41ac1a4f50132a83349754f6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 19 Jun 2022 22:00:54 +0200 Subject: [PATCH] Remove unnecessary TempLocaleSetter::m_localeId We don't need to store this string, we don't need it after the ctor. Also change the default value of an argument of wxString reference type to be a wxString, not a const char*. --- include/wx/unix/private/uilocale.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/wx/unix/private/uilocale.h b/include/wx/unix/private/uilocale.h index 7d3e159ffd..a371a51792 100644 --- a/include/wx/unix/private/uilocale.h +++ b/include/wx/unix/private/uilocale.h @@ -41,11 +41,12 @@ namespace class TempLocaleSetter { public: - explicit TempLocaleSetter(int localeCategory, const wxString& localeId = "") - : m_localeCategory(localeCategory), m_localeId(localeId), + explicit TempLocaleSetter(int localeCategory, + const wxString& localeId = wxString()) + : m_localeCategory(localeCategory), m_localeOrig(strdup(setlocale(localeCategory, NULL))) { - setlocale(localeCategory, m_localeId.mb_str()); + setlocale(localeCategory, localeId.mb_str()); } ~TempLocaleSetter() @@ -56,7 +57,6 @@ public: private: const int m_localeCategory; - wxString m_localeId; char* const m_localeOrig; wxDECLARE_NO_COPY_CLASS(TempLocaleSetter);