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.
This commit is contained in:
Vadim Zeitlin
2019-08-25 00:55:40 +02:00
parent 1527e657c3
commit 93983ee229

View File

@@ -2502,9 +2502,6 @@ bool wxFileName::SetPermissions(int permissions)
return wxChmod(GetFullPath(), permissions) == 0; 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 // Returns the native path for a file URL
wxFileName wxFileName::URLToFileName(const wxString& url) wxFileName wxFileName::URLToFileName(const wxString& url)
{ {
@@ -2537,7 +2534,7 @@ wxFileName wxFileName::URLToFileName(const wxString& url)
} }
#endif #endif
path.Replace(g_unixPathString, g_nativePathString); path.Replace(wxS('/'), wxFILE_SEP_PATH);
return wxFileName(path, wxPATH_NATIVE); return wxFileName(path, wxPATH_NATIVE);
} }
@@ -2587,7 +2584,7 @@ wxString wxFileName::FileNameToURL(const wxFileName& filename)
} }
#endif #endif
url.Replace(g_nativePathString, g_unixPathString); url.Replace(wxFILE_SEP_PATH, wxS('/'));
// Do wxURI- and common practice-compatible escaping: encode the string // Do wxURI- and common practice-compatible escaping: encode the string
// into UTF-8, then escape anything non-ASCII: // into UTF-8, then escape anything non-ASCII: