Patch [ 971542 ] Tiny speedup for stc2wx in PlatWX.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6923d0a947
commit
8a07b43cf6
@ -1251,6 +1251,10 @@ double ElapsedTime::Duration(bool reset) {
|
|||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxString stc2wx(const char* str, size_t len)
|
wxString stc2wx(const char* str, size_t len)
|
||||||
{
|
{
|
||||||
|
if (str[len] == 0)
|
||||||
|
// It's already terminated correctly.
|
||||||
|
return wxString(str, wxConvUTF8, len);
|
||||||
|
|
||||||
char *buffer=new char[len+1];
|
char *buffer=new char[len+1];
|
||||||
strncpy(buffer, str, len);
|
strncpy(buffer, str, len);
|
||||||
buffer[len]=0;
|
buffer[len]=0;
|
||||||
|
@ -1251,6 +1251,10 @@ double ElapsedTime::Duration(bool reset) {
|
|||||||
#if wxUSE_UNICODE
|
#if wxUSE_UNICODE
|
||||||
wxString stc2wx(const char* str, size_t len)
|
wxString stc2wx(const char* str, size_t len)
|
||||||
{
|
{
|
||||||
|
if (str[len] == 0)
|
||||||
|
// It's already terminated correctly.
|
||||||
|
return wxString(str, wxConvUTF8, len);
|
||||||
|
|
||||||
char *buffer=new char[len+1];
|
char *buffer=new char[len+1];
|
||||||
strncpy(buffer, str, len);
|
strncpy(buffer, str, len);
|
||||||
buffer[len]=0;
|
buffer[len]=0;
|
||||||
|
Loading…
Reference in New Issue
Block a user