summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-11-10 20:02:47 +0100
committerLars Knoll <lars.knoll@qt.io>2020-11-17 11:47:02 +0100
commit168772fe8f1d83ffb480c3cc049595c82b4720df (patch)
tree0b0007972e9820b8ceda0fd7ff6a2525faf8997e /src/corelib/tools/qarraydatapointer.h
parentf1db4d6e385deae976b6bf9b3cd392b794e09383 (diff)
Remove destructor calls from insert()
QList::insert() should never need to call a destructor. This requires that we construct the new items in the list in order and increment the size each time we constructed a new item. Not having a code path that potentially calls destructors should avoid the generation of lots of additional code for those operations. In addition, the forward and backwards code paths are now unified and only require somewhat different setup of some variables at the start. This gives us strong exception safety when appending one item, weak exception safety in all other cases (in line with std::vector). Change-Id: I6bf88365a34ea9e55ed1236be01a65499275d150 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 1aa9a670e7..763a5f7927 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -282,11 +282,8 @@ public:
return lhs.data() != rhs.data() || lhs.size != rhs.size;
}
-protected:
Data *d;
T *ptr;
-
-public:
qsizetype size;
};