summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qarraydata/simplevector.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qarraydata/simplevector.h')
-rw-r--r--tests/auto/corelib/tools/qarraydata/simplevector.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/auto/corelib/tools/qarraydata/simplevector.h b/tests/auto/corelib/tools/qarraydata/simplevector.h
index f433743911..b92cd4a887 100644
--- a/tests/auto/corelib/tools/qarraydata/simplevector.h
+++ b/tests/auto/corelib/tools/qarraydata/simplevector.h
@@ -1,5 +1,5 @@
// Copyright (C) 2020 The Qt Company Ltd.
-// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef QARRAY_TEST_SIMPLE_VECTOR_H
@@ -28,7 +28,7 @@ public:
}
explicit SimpleVector(size_t n, bool capacityReserved = false)
- : d(Data::allocate(n))
+ : d(n)
{
if (n)
d->appendInitialize(n);
@@ -37,7 +37,7 @@ public:
}
SimpleVector(size_t n, const T &t, bool capacityReserved = false)
- : d(Data::allocate(n))
+ : d(n)
{
if (n)
d->copyAppend(n, t);
@@ -46,7 +46,7 @@ public:
}
SimpleVector(const T *begin, const T *end, bool capacityReserved = false)
- : d(Data::allocate(end - begin))
+ : d(end - begin)
{
if (end - begin)
d->copyAppend(begin, end);
@@ -59,11 +59,6 @@ public:
{
}
- explicit SimpleVector(QPair<Data*, T*> ptr, size_t len = 0)
- : d(ptr, len)
- {
- }
-
SimpleVector(const QArrayDataPointer<T> &other)
: d(other)
{
@@ -135,7 +130,7 @@ public:
}
}
- SimpleVector detached(Data::allocate(qMax(n, size())));
+ SimpleVector detached(DataPointer(qMax(n, size())));
if (size()) {
detached.d->copyAppend(constBegin(), constEnd());
detached.d->setFlag(QArrayData::CapacityReserved);
@@ -149,7 +144,7 @@ public:
return;
if (d->needsDetach() || newSize > capacity()) {
- SimpleVector detached(Data::allocate(d->detachCapacity(newSize)));
+ SimpleVector detached(DataPointer(d->detachCapacity(newSize)));
if (newSize) {
if (newSize < size()) {
const T *const begin = constBegin();
@@ -223,7 +218,7 @@ public:
const T *const end = begin + d->size;
if (d->needsDetach()) {
- SimpleVector detached(Data::allocate(d->detachCapacity(size() - (last - first))));
+ SimpleVector detached(DataPointer(d->detachCapacity(size() - (last - first))));
if (first != begin)
detached.d->copyAppend(begin, first);
detached.d->copyAppend(last, end);