diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-23 00:15:30 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-23 09:38:38 +0000 |
commit | b78097b22d11a7279551709b28ef49d403407449 (patch) | |
tree | df23177fb98e02da88b8be66293e0f8856f38a15 /src/printsupport/kernel/qprinter.cpp | |
parent | 2d4295f16761a0e47b5218bbb1db5c14d16ce4fe (diff) |
QtPrintSupport: eradicate all Q_FOREACH loops
Saves more than 2KiB in text size on optimized GCC 4.9 Linux
AMD64 builds, iow: ~0.5% of the total library size.
Change-Id: I84e1dc208da13eefdf1573c9b7ac7c9d76a7f5c7
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/printsupport/kernel/qprinter.cpp')
-rw-r--r-- | src/printsupport/kernel/qprinter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp index 734691d504..7f08bdb3e9 100644 --- a/src/printsupport/kernel/qprinter.cpp +++ b/src/printsupport/kernel/qprinter.cpp @@ -160,7 +160,8 @@ void QPrinterPrivate::changeEngines(QPrinter::OutputFormat format, const QPrinte initEngines(format, printer); if (oldPrintEngine) { - foreach (QPrintEngine::PrintEnginePropertyKey key, m_properties) { + const auto properties = m_properties; // take a copy: setProperty() below modifies m_properties + for (const auto &key : properties) { QVariant prop; // PPK_NumberOfCopies need special treatmeant since it in most cases // will return 1, disregarding the actual value that was set |