diff options
Diffstat (limited to 'tests/benchmarks/gui')
-rw-r--r-- | tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp index e458fc1c80..dd903ab8a1 100644 --- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp +++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp @@ -87,11 +87,7 @@ void tst_QPixmapCache::insert() if (cacheType) { QBENCHMARK { for (int i = 0 ; i <= 10000 ; i++) - { - QString tmp; - tmp.sprintf("my-key-%d", i); - QPixmapCache::insert(tmp, p); - } + QPixmapCache::insert(QString::asprintf("my-key-%d", i), p); } } else { QBENCHMARK { @@ -114,12 +110,8 @@ void tst_QPixmapCache::find() QPixmap p; if (cacheType) { QBENCHMARK { - QString tmp; for (int i = 0 ; i <= 10000 ; i++) - { - tmp.sprintf("my-key-%d", i); - QPixmapCache::find(tmp, p); - } + QPixmapCache::find(QString::asprintf("my-key-%d", i), p); } } else { QBENCHMARK { @@ -165,18 +157,10 @@ void tst_QPixmapCache::styleUseCaseComplexKey() if (cacheType) { QBENCHMARK { for (int i = 0 ; i <= 10000 ; i++) - { - QString tmp; - tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200); - QPixmapCache::insert(tmp, p); - } + QPixmapCache::insert(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p); for (int i = 0 ; i <= 10000 ; i++) - { - QString tmp; - tmp.sprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200); - QPixmapCache::find(tmp, p); - } + QPixmapCache::find(QString::asprintf("%s-%d-%d-%d-%d-%d-%d", QString("my-progressbar-%1").arg(i).toLatin1().constData(), 5, 3, 0, 358, 100, 200), p); } } else { QHash<styleStruct, QPixmapCache::Key> hash; |