optimize Replace() to use a linear algorithm (closes #9135)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -281,6 +281,18 @@ BENCHMARK_FUNC(ReplaceAll)
|
||||
return str.Replace("x", "y") != 0;
|
||||
}
|
||||
|
||||
BENCHMARK_FUNC(ReplaceLonger)
|
||||
{
|
||||
wxString str('x', ASCIISTR_LEN);
|
||||
return str.Replace("x", "yy") != 0;
|
||||
}
|
||||
|
||||
BENCHMARK_FUNC(ReplaceShorter)
|
||||
{
|
||||
wxString str('x', ASCIISTR_LEN);
|
||||
return str.Replace("xx", "y") != 0;
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// string buffers: wx[W]CharBuffer
|
||||
|
Reference in New Issue
Block a user