Take wxFormatString in wxString::Format() and sprintf() too

The argument of these functions will have to be converted to
wxFormatString anyhow in Printf(), so take it directly, as this at least
means that only a single conversion will be done, when Format() is
called, instead of converting whatever is passed to it to wxString
before converting this wxString to wxFormatString.
This commit is contained in:
Vadim Zeitlin 2022-11-22 19:41:28 +01:00
parent e21b77cb14
commit c453167c71

View file

@ -2212,7 +2212,7 @@ public:
// returns the string containing the result of Printf() to it
template <typename... Targs>
static wxString Format(const wxString& format, Targs... args)
static wxString Format(const wxFormatString& format, Targs... args)
{
wxString s;
s.Printf(format, args...);
@ -2241,7 +2241,7 @@ public:
// use Printf()
template <typename... Targs>
int sprintf(const wxString& format, Targs... args)
int sprintf(const wxFormatString& format, Targs... args)
{
return Printf(format, args...);
}