summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlist.cpp')
-rw-r--r--src/corelib/tools/qlist.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp
index 2afe1ab969..8eb4be090a 100644
--- a/src/corelib/tools/qlist.cpp
+++ b/src/corelib/tools/qlist.cpp
@@ -146,7 +146,7 @@ QListData::Data *QListData::detach(int alloc)
void QListData::realloc(int alloc)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
Data *x = static_cast<Data *>(::realloc(d, DataHeaderSize + alloc * sizeof(void *)));
Q_CHECK_PTR(x);
@@ -159,7 +159,7 @@ void QListData::realloc(int alloc)
// ensures that enough space is available to append n elements
void **QListData::append(int n)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
int e = d->end;
if (e + n > d->alloc) {
int b = d->begin;
@@ -190,7 +190,7 @@ void **QListData::append(const QListData& l)
void **QListData::prepend()
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
if (d->begin == 0) {
if (d->end >= d->alloc / 3)
realloc(grow(d->alloc + 1));
@@ -208,7 +208,7 @@ void **QListData::prepend()
void **QListData::insert(int i)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
if (i <= 0)
return prepend();
int size = d->end - d->begin;
@@ -247,7 +247,7 @@ void **QListData::insert(int i)
void QListData::remove(int i)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
i += d->begin;
if (i - d->begin < d->end - i) {
if (int offset = i - d->begin)
@@ -262,7 +262,7 @@ void QListData::remove(int i)
void QListData::remove(int i, int n)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
i += d->begin;
int middle = i + n/2;
if (middle - d->begin < d->end - middle) {
@@ -278,7 +278,7 @@ void QListData::remove(int i, int n)
void QListData::move(int from, int to)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
if (from == to)
return;
@@ -318,7 +318,7 @@ void QListData::move(int from, int to)
void **QListData::erase(void **xi)
{
- Q_ASSERT(d->ref == 1);
+ Q_ASSERT(!d->ref.isShared());
int i = xi - (d->array + d->begin);
remove(i);
return d->array + d->begin + i;