summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwriteinitialization.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-05-19 23:25:12 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-05-21 21:57:20 +0200
commitb03385f9cff7acc2b37933f493e3eff2d8bbef59 (patch)
treebe519e92d527bc3878c2b58d3d006f099019dd83 /src/tools/uic/cpp/cppwriteinitialization.h
parent4e026a2076dd6f612871e30fdcf49312b4647846 (diff)
QFileSystemWatcherEngines: port some Java-style iterators to ranged-for
Java-style iterators are scheduled to be deprecated. The general pattern used in the patch is that instead of copying an input list, then iterating over the copy with some calls to it.remove() (which leads to quadratic-complexity loops), we simply copy conditionally (a la remove_copy_if instead of remove_if). To make clearer what's going on, rename the outgoing list to 'unhandled'. To avoid having to touch too much of the loops' structure, which sometimes is quite convoluted, use qScopeGuard to do the append to 'unhandled', unless the original code removed the element. Saves a surprising almost 5KiB in text size on GCC 9.1 optimized AMD64 Linux builds. Change-Id: Ifd861de9aa48d66b420858606998dd08a8401e03 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/tools/uic/cpp/cppwriteinitialization.h')
0 files changed, 0 insertions, 0 deletions