summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.h
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2011-12-16 17:22:45 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-04 23:37:58 +0100
commit7fadc3ce322706ed6c36ad907e83fed1992b490e (patch)
tree4f8fcd91d2459841d1af4916e438da9a9d934a89 /src/corelib/tools/qvector.h
parent7d16ea40331dc4480af823288e6ed3ca58a677d8 (diff)
Get rid of assignment operators in RefCount
, and make it strictly a POD struct. Since this operator was only being used to set the initial (owned) value of the reference count, the name of the function introduced here to replace it makes that use case explicit. Change-Id: I2feadd2ac35dcb75ca211471baf5044a5f57cd62 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r--src/corelib/tools/qvector.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index eab9311eb3..f408f6571f 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -411,7 +411,7 @@ template <typename T>
QVector<T>::QVector(int asize)
{
d = malloc(asize);
- d->ref = 1;
+ d->ref.initializeOwned();
d->alloc = d->size = asize;
d->sharable = true;
d->capacity = false;
@@ -429,7 +429,7 @@ template <typename T>
QVector<T>::QVector(int asize, const T &t)
{
d = malloc(asize);
- d->ref = 1;
+ d->ref.initializeOwned();
d->alloc = d->size = asize;
d->sharable = true;
d->capacity = false;
@@ -443,7 +443,7 @@ template <typename T>
QVector<T>::QVector(std::initializer_list<T> args)
{
d = malloc(int(args.size()));
- d->ref = 1;
+ d->ref.initializeOwned();
d->alloc = d->size = int(args.size());
d->sharable = true;
d->capacity = false;
@@ -515,7 +515,7 @@ void QVector<T>::realloc(int asize, int aalloc)
QT_RETHROW;
}
}
- x.d->ref = 1;
+ x.d->ref.initializeOwned();
x.d->alloc = aalloc;
x.d->sharable = true;
x.d->capacity = d->capacity;