Don't call strlen() unnecessarily in wxFFile::Write().

We already have the length of the string, either in the buffer if we actually
converted the string from Unicode to multi-byte, or in the string itself in
non-Unicode build.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76792 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-06-30 01:00:10 +00:00
parent 72448a032a
commit c78b1fa01c

View File

@@ -157,7 +157,12 @@ bool wxFFile::Write(const wxString& s, const wxMBConv& conv)
if ( !buf )
return false;
const size_t size = strlen(buf); // FIXME: use buf.length() when available
#if wxUSE_UNICODE
const size_t size = buf.length();
#else
const size_t size = s.length();
#endif
return Write(buf, size) == size;
}