aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-07-24 16:23:50 +0300
committerMarc Mutz <marc.mutz@kdab.com>2019-07-25 14:40:11 +0000
commit2e556c96b6c867232ee844495f38d1ee267e43fd (patch)
treee516457bc1bc7a11127b1c7747453d3950bc1d92 /src/plugins/qmlprofiler
parent8ae9cfe39d9fbf114f23bc00e7a66516c2429648 (diff)
QmlProfiler: avoid using Q_FOREACH over QVarLengthArray
The squeeze() function is called by clients for QVLA's, which means it's copying 1-2KiB of data (depending on sizeof(value_type)) just to iterate over a small part of it. Use a C++11 ranged for loop. Change-Id: I2c33ae0c5a3d9d941cd9e385fc6bbb4fb0fa3c2c Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/qmlevent.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmlprofiler/qmlevent.h b/src/plugins/qmlprofiler/qmlevent.h
index dc1b85116d..344ef1a7ce 100644
--- a/src/plugins/qmlprofiler/qmlevent.h
+++ b/src/plugins/qmlprofiler/qmlevent.h
@@ -251,7 +251,7 @@ private:
squeeze(const Container &numbers)
{
using Small = typename QIntegerForSize<sizeof(Number) / 2>::Signed;
- foreach (Number item, numbers) {
+ for (Number item : numbers) {
if (!squeezable<Number, Small>(item))
return false;
}