summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtestcase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtestcase.cpp')
-rw-r--r--src/testlib/qtestcase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index 1a634a0f75..7b567674e4 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -332,7 +332,9 @@ static void qPrintDataTags(FILE *stream)
member.resize(qstrlen(slot) + qstrlen("_data()") + 1);
qsnprintf(member.data(), member.size(), "%s_data()", slot);
invokeMethod(QTest::currentTestObject, member.constData());
- for (int j = 0; j < table.dataCount(); ++j)
+ const int dataCount = table.dataCount();
+ localTags.reserve(dataCount);
+ for (int j = 0; j < dataCount; ++j)
localTags << QLatin1String(table.testData(j)->dataTag());
// Print all tag combinations: