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 <ogoffart@woboq.com>
bb10
Thiago Macieira 2012-05-02 17:15:08 +02:00 committed by Qt by Nokia
parent 19d160b72b
commit 425b925b7e
1 changed files with 1 additions and 2 deletions

View File

@ -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;
};