qt6-bb10/tests/auto/corelib/text
Ahmad Samir eb60e94020 QString: don't detach in replace_helper()
I.e. don't detach in the replace() overloads that delegate to
replace_helper() if this string is shared, instead create a new string
and copy characters from this string to it, along with the "after"
string, then swap it with this.

Do the same thing if "before" is shorter than "after" and there isn't
enough capacity to do the replacement without reallocating.

Use std::copy* and std::move*, which will both fallback to
memmove/memcpy, but they have C++ API, which is more readable.

[ChangeLog][QtCore][QString] Using replace() on a currently shared
QString is now done more efficiently

Task-number: QTBUG-106184
Change-Id: If74ffa1ed47636dc23d543d6dc123d8f2b21d537
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-02-09 22:52:01 +02:00
..
qanystringview Make XmlStringRef convertible to QAnyStringView/QStringView 2022-11-29 20:03:06 +00:00
qbytearray QString, QByteArray: don't detach in removeIf/erase/eraseif() 2023-02-09 16:46:39 +02:00
qbytearray_large tst_QByteArrayLarge::initTestCase: Skip tests under ASAN 2022-11-30 04:50:37 +01:00
qbytearrayapisymmetry QByteArrayApiSymmetry: silence two clang warnings 2022-12-13 14:41:29 +02:00
qbytearraylist Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbytearraymatcher Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qbytearrayview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbytedatabuffer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qchar tst_QChar::fromUcs4(): deduplicate a test-case 2022-10-18 14:13:28 +02:00
qcollator Correctly determine if posix collator is used in tst_qcollator 2023-01-10 23:25:42 +01:00
qlatin1stringmatcher Add Boyer-Moore Latin-1 string searcher with optional case sensitivity 2022-12-08 17:56:47 +01:00
qlatin1stringview QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines 2022-08-24 22:08:49 +02:00
qlocale Update CLDR to v42 2023-02-07 19:04:11 +01:00
qregularexpression tst_QRE::wildcard(): use more informative data row tags 2022-10-11 11:24:11 +02:00
qstring QString: don't detach in replace_helper() 2023-02-09 22:52:01 +02:00
qstring_no_cast_from_bytearray Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringapisymmetry Use consistent collation testability criteria in corelib/text 2023-01-11 08:47:59 +00:00
qstringbuilder Adapt the qstringbuilder test for batching 2023-01-10 20:09:35 +01:00
qstringconverter QStringConverter: add QLatin1::convert{To,From}Unicode() 2022-12-30 16:36:24 +02:00
qstringiterator Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringlist Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qstringmatcher Reduce foldCasing of the needle in Boyer-Moore QString searches 2022-09-22 18:05:44 +02:00
qstringtokenizer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringview Make XmlStringRef convertible to QAnyStringView/QStringView 2022-11-29 20:03:06 +00:00
qtextboundaryfinder Remove tst_QTextBoundaryFinder::thaiLineBreak 2023-01-13 17:20:55 +01:00
qunicodetools Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
shared Provide optTitle for a NumberDoubleTestData testcase that needs it 2022-10-11 11:21:38 +02:00
CMakeLists.txt Add Boyer-Moore Latin-1 string searcher with optional case sensitivity 2022-12-08 17:56:47 +01:00