From 425b925b7e9dd818f2a58fd7bc77bfe8475e6483 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 May 2012 17:15:08 +0200 Subject: Simplify the size of the QVarLengthArray buffer. The previous calculation was too complex for no good reason. QVarLengthArray actually doesn't change the size after this change due to padding, but we don't need to include the padding in our own calculation. Task-number: QTBUG-25113 Change-Id: I72ea214f0d96870ecf8ff65737e7ca14e19afc7a Reviewed-by: Olivier Goffart --- src/corelib/tools/qvarlengtharray.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index 639d2463fd..58b26be4a9 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -180,8 +180,7 @@ private: int s; // size T *ptr; // data union { - // ### Qt 5: Use 'Prealloc * sizeof(T)' as array size - char array[sizeof(qint64) * (((Prealloc * sizeof(T)) / sizeof(qint64)) + 1)]; + char array[Prealloc * sizeof(T)]; qint64 q_for_alignment_1; double q_for_alignment_2; }; -- cgit v1.2.3