Make clear() use the shared null inline
There isn't a good reason to impose the additional library call and using the shared null here matches existing behavior in QByteArray, QString and QVector. Change-Id: Idd0bb9c7411db52630402534a11d87cbf2b1e7ba Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
e32d417b51
commit
632840cb0f
@ -141,7 +141,7 @@ public:
|
|||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
QArrayDataPointer tmp(d);
|
QArrayDataPointer tmp(d);
|
||||||
d = Data::allocate(0);
|
d = Data::sharedNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool detach()
|
bool detach()
|
||||||
|
@ -242,7 +242,7 @@ void tst_QArrayData::simpleVector()
|
|||||||
QVERIFY(v1.isNull());
|
QVERIFY(v1.isNull());
|
||||||
QVERIFY(v2.isNull());
|
QVERIFY(v2.isNull());
|
||||||
QVERIFY(v3.isNull());
|
QVERIFY(v3.isNull());
|
||||||
QVERIFY(!v4.isNull());
|
QVERIFY(v4.isNull());
|
||||||
QVERIFY(!v5.isNull());
|
QVERIFY(!v5.isNull());
|
||||||
QVERIFY(!v6.isNull());
|
QVERIFY(!v6.isNull());
|
||||||
QVERIFY(!v7.isNull());
|
QVERIFY(!v7.isNull());
|
||||||
@ -306,7 +306,7 @@ void tst_QArrayData::simpleVector()
|
|||||||
|
|
||||||
QVERIFY(v1.isSharedWith(v2));
|
QVERIFY(v1.isSharedWith(v2));
|
||||||
QVERIFY(v1.isSharedWith(v3));
|
QVERIFY(v1.isSharedWith(v3));
|
||||||
QVERIFY(!v1.isSharedWith(v4));
|
QVERIFY(v1.isSharedWith(v4));
|
||||||
QVERIFY(!v1.isSharedWith(v5));
|
QVERIFY(!v1.isSharedWith(v5));
|
||||||
QVERIFY(!v1.isSharedWith(v6));
|
QVERIFY(!v1.isSharedWith(v6));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user