summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearray.cpp
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2022-11-26 12:50:00 +0200
committerAhmad Samir <a.samirh78@gmail.com>2022-12-11 15:44:26 +0200
commit2fe3b0e5640df34d5512e06ecbc5739c2d4df21e (patch)
tree600624fcc281e5b5d1ade2a153ee6c325c594a12 /src/corelib/text/qbytearray.cpp
parentfa2153bd10057d7adbc5f5ededa1fd97c4a68161 (diff)
QContainerTools: add q_points_into_range overload
Looking at the use-cases of the already existing q_points_into_range overload, all of them can be ported to the new one (i.e. all of them were using range [begin, end)). Change-Id: I4bfdd68271512b88a9800a16237ff967a367eaeb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qbytearray.cpp')
-rw-r--r--src/corelib/text/qbytearray.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp
index 9eabf22600..f4b4523b68 100644
--- a/src/corelib/text/qbytearray.cpp
+++ b/src/corelib/text/qbytearray.cpp
@@ -2151,7 +2151,7 @@ QByteArray &QByteArray::insert(qsizetype i, QByteArrayView data)
return *this;
}
- if (!d->needsDetach() && QtPrivate::q_points_into_range(str, d.data(), d.data() + d.size)) {
+ if (!d->needsDetach() && QtPrivate::q_points_into_range(str, d)) {
QVarLengthArray a(str, str + size);
return insert(i, a);
}
@@ -2327,7 +2327,7 @@ QByteArray &QByteArray::remove(qsizetype pos, qsizetype len)
QByteArray &QByteArray::replace(qsizetype pos, qsizetype len, QByteArrayView after)
{
- if (QtPrivate::q_points_into_range(after.data(), d.data(), d.data() + d.size)) {
+ if (QtPrivate::q_points_into_range(after.data(), d)) {
QVarLengthArray copy(after.data(), after.data() + after.size());
return replace(pos, len, QByteArrayView{copy});
}
@@ -2387,11 +2387,11 @@ QByteArray &QByteArray::replace(QByteArrayView before, QByteArrayView after)
return *this;
// protect against before or after being part of this
- if (QtPrivate::q_points_into_range(a, d.data(), d.data() + d.size)) {
+ if (QtPrivate::q_points_into_range(a, d)) {
QVarLengthArray copy(a, a + asize);
return replace(before, QByteArrayView{copy});
}
- if (QtPrivate::q_points_into_range(b, d.data(), d.data() + d.size)) {
+ if (QtPrivate::q_points_into_range(b, d)) {
QVarLengthArray copy(b, b + bsize);
return replace(QByteArrayView{copy}, after);
}