diff options
author | Paul Wicking <paul.wicking@qt.io> | 2019-12-09 18:42:56 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2019-12-10 20:00:26 +0100 |
commit | 77f9699a7c336e67a2ae6d37b75411528954c705 (patch) | |
tree | d55d3781088208df4b850f7528a46dd243db884d /src/qdoc/cppcodemarker.cpp | |
parent | 88b135fb74689484dfa60ee0efd378d85a9f0a75 (diff) | |
download | qttools-77f9699a7c336e67a2ae6d37b75411528954c705.tar.gz |
QDoc: Clean up loops with iterators
- Use ranged-based fors where applicable.
- Use auto keyword for iterators.
- Move a few variable declarations to where they're to be used.
- Update docs where applicable.
Fixes: QTBUG-80536
Change-Id: I859440b96428dec4ef108b01d391479d3f8dbd83
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/qdoc/cppcodemarker.cpp')
-rw-r--r-- | src/qdoc/cppcodemarker.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/qdoc/cppcodemarker.cpp b/src/qdoc/cppcodemarker.cpp index a26dedc76..251f0cef6 100644 --- a/src/qdoc/cppcodemarker.cpp +++ b/src/qdoc/cppcodemarker.cpp @@ -422,11 +422,9 @@ QString CppCodeMarker::markedUpIncludes(const QStringList &includes) { QString code; - QStringList::ConstIterator inc = includes.constBegin(); - while (inc != includes.constEnd()) { - code += "<@preprocessor>#include <<@headerfile>" + *inc + "</@headerfile>></@preprocessor>\n"; - ++inc; - } + for (const auto &include : includes) + code += "<@preprocessor>#include <<@headerfile>" + + include + "</@headerfile>></@preprocessor>\n"; return code; } |