From 7fadc3ce322706ed6c36ad907e83fed1992b490e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Fri, 16 Dec 2011 17:22:45 +0100 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/tools/qlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools/qlist.cpp') diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index 94be78ea21..8ef5fadb73 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -85,7 +85,7 @@ QListData::Data *QListData::detach_grow(int *idx, int num) Data* t = static_cast(qMalloc(DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); - t->ref = 1; + t->ref.initializeOwned(); t->sharable = true; t->alloc = alloc; // The space reservation algorithm's optimization is biased towards appending: @@ -127,7 +127,7 @@ QListData::Data *QListData::detach(int alloc) Data* t = static_cast(qMalloc(DataHeaderSize + alloc * sizeof(void *))); Q_CHECK_PTR(t); - t->ref = 1; + t->ref.initializeOwned(); t->sharable = true; t->alloc = alloc; if (!alloc) { -- cgit v1.2.3