tst_qmlstream: re-use QBuffer instance in readBack()
This improves the runtime of this particular test function by almost 17% on my machine. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: Icd77cdda92374b92121988c99e56787d405fa2d9 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>bb10
parent
f8a9047c9c
commit
7fa6670fa4
|
|
@ -1681,10 +1681,11 @@ static bool isValidSingleTextChar(const ushort c)
|
|||
|
||||
void tst_QXmlStream::readBack() const
|
||||
{
|
||||
for (ushort c = 0; c < std::numeric_limits<ushort>::max(); ++c) {
|
||||
QBuffer buffer;
|
||||
QBuffer buffer;
|
||||
|
||||
QVERIFY(buffer.open(QIODevice::WriteOnly));
|
||||
for (ushort c = 0; c < std::numeric_limits<ushort>::max(); ++c) {
|
||||
|
||||
QVERIFY(buffer.open(QIODevice::WriteOnly|QIODevice::Truncate));
|
||||
QXmlStreamWriter writer(&buffer);
|
||||
writer.writeStartDocument();
|
||||
writer.writeTextElement("a", QString(QChar(c)));
|
||||
|
|
|
|||
Loading…
Reference in New Issue