From b78097b22d11a7279551709b28ef49d403407449 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 23 Dec 2015 00:15:30 +0100 Subject: 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) --- src/printsupport/kernel/qprinter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/printsupport/kernel/qprinter.cpp') 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 -- cgit v1.2.3