From: Václav Slavík Date: Fri, 24 Dec 1999 23:28:05 +0000 (+0000) Subject: fixed bug in wxString::DoCopy - it called Sort on already sorted array (thanks to... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/bb65ef80feb05e4df68a30e1ef3786158957b00f fixed bug in wxString::DoCopy - it called Sort on already sorted array (thanks to Add behaviour) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/string.cpp b/src/common/string.cpp index 7773d3b552..da23dda0f4 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1802,20 +1802,8 @@ void wxArrayString::Copy(const wxArrayString& src) if ( src.m_nCount > ARRAY_DEFAULT_INITIAL_SIZE ) Alloc(src.m_nCount); - // we can't just copy the pointers here because otherwise we would share - // the strings with another array because strings are ref counted -#if 0 - if ( m_nCount != 0 ) - memcpy(m_pItems, src.m_pItems, m_nCount*sizeof(wxChar *)); -#endif // 0 - for ( size_t n = 0; n < src.m_nCount; n++ ) Add(src[n]); - - // if the other array is auto sorted too, we're already sorted, but - // otherwise we should rearrange the items - if ( m_autoSort && !src.m_autoSort ) - Sort(); } // grow the array