From 93983ee229e3fa3347ce8aa384feb03d9c7645ee Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 25 Aug 2019 00:55:40 +0200 Subject: [PATCH] Remove not really needed global variables in wxFileName code There is no need to initialize these 2 strings on each and every wx program startup. No real changes. --- src/common/filename.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index 3ad3b2d607..76f4639c5c 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -2502,9 +2502,6 @@ bool wxFileName::SetPermissions(int permissions) return wxChmod(GetFullPath(), permissions) == 0; } -static const wxString g_unixPathString(wxT("/")); -static const wxString g_nativePathString(wxFILE_SEP_PATH); - // Returns the native path for a file URL wxFileName wxFileName::URLToFileName(const wxString& url) { @@ -2537,7 +2534,7 @@ wxFileName wxFileName::URLToFileName(const wxString& url) } #endif - path.Replace(g_unixPathString, g_nativePathString); + path.Replace(wxS('/'), wxFILE_SEP_PATH); return wxFileName(path, wxPATH_NATIVE); } @@ -2587,7 +2584,7 @@ wxString wxFileName::FileNameToURL(const wxFileName& filename) } #endif - url.Replace(g_nativePathString, g_unixPathString); + url.Replace(wxFILE_SEP_PATH, wxS('/')); // Do wxURI- and common practice-compatible escaping: encode the string // into UTF-8, then escape anything non-ASCII: