QGraphicsAnchorLayout: replace a Q_FOREACH with std::accumulate
Saves ~0.5KiB in text size on optimized Linux AMD64 GCC 4.9 builds. Change-Id: Iba2c02eed44f1ee3521bc49fe7afae9c2e916fdc Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
2cc2bcca94
commit
f2d8d9daee
@ -42,6 +42,7 @@
|
||||
#include <QtCore/qfile.h>
|
||||
#endif
|
||||
|
||||
#include <numeric>
|
||||
|
||||
#ifndef QT_NO_GRAPHICSVIEW
|
||||
QT_BEGIN_NAMESPACE
|
||||
@ -2180,10 +2181,7 @@ static void shiftConstraints(const QList<QSimplexConstraint *> &constraints, qre
|
||||
{
|
||||
for (int i = 0; i < constraints.count(); ++i) {
|
||||
QSimplexConstraint *c = constraints.at(i);
|
||||
qreal multiplier = 0;
|
||||
foreach (qreal v, c->variables) {
|
||||
multiplier += v;
|
||||
}
|
||||
const qreal multiplier = std::accumulate(c->variables.cbegin(), c->variables.cend(), qreal(0));
|
||||
c->constant += multiplier * amount;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user