corrected a bug in ConcatSelf() induced by the latest change
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -441,9 +441,8 @@ void wxString::ConcatSelf(int nSrcLen, const char *pszSrcData)
|
||||
{
|
||||
STATISTICS_ADD(SummandLength, nSrcLen);
|
||||
|
||||
// concatenating an empty string is a NOP, but it happens quite rarely,
|
||||
// so we don't waste our time checking for it
|
||||
// if ( nSrcLen > 0 )
|
||||
// concatenating an empty string is a NOP
|
||||
if ( nSrcLen > 0 ) {
|
||||
wxStringData *pData = GetStringData();
|
||||
size_t nLen = pData->nDataLength;
|
||||
size_t nNewLen = nLen + nSrcLen;
|
||||
@@ -479,6 +478,8 @@ void wxString::ConcatSelf(int nSrcLen, const char *pszSrcData)
|
||||
m_pchData[nNewLen] = '\0'; // put terminating '\0'
|
||||
GetStringData()->nDataLength = nNewLen; // and fix the length
|
||||
}
|
||||
//else: the string to append was empty
|
||||
}
|
||||
|
||||
/*
|
||||
* concatenation functions come in 5 flavours:
|
||||
|
Reference in New Issue
Block a user