From 2fe3b0e5640df34d5512e06ecbc5739c2d4df21e Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sat, 26 Nov 2022 12:50:00 +0200 Subject: 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 --- src/corelib/tools/qarraydataops.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qarraydataops.h') diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h index 13d5572c03..d50c74f2c2 100644 --- a/src/corelib/tools/qarraydataops.h +++ b/src/corelib/tools/qarraydataops.h @@ -916,11 +916,10 @@ public: DataPointer old; // points into range: - if (QtPrivate::q_points_into_range(b, this->begin(), this->end())) { + if (QtPrivate::q_points_into_range(b, *this)) this->detachAndGrow(QArrayData::GrowsAtEnd, n, &b, &old); - } else { + else this->detachAndGrow(QArrayData::GrowsAtEnd, n, nullptr, nullptr); - } Q_ASSERT(this->freeSpaceAtEnd() >= n); // b might be updated so use [b, n) this->copyAppend(b, b + n); -- cgit v1.2.3