diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-14 01:40:53 +0100 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2019-01-21 09:00:18 +0000 |
commit | 1d3d18a96988eb091b207103f18c9fbba505013a (patch) | |
tree | ea96a5524d5dbda96447455a9152484e54ea6e3b /src/plugins/cpptools/cppsourceprocessor.cpp | |
parent | 845af928896ba1ef1bb7259766913ea7f4c35cd9 (diff) | |
download | qt-creator-1d3d18a96988eb091b207103f18c9fbba505013a.tar.gz |
CppTools: modernize
Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp')
-rw-r--r-- | src/plugins/cpptools/cppsourceprocessor.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/cpptools/cppsourceprocessor.cpp b/src/plugins/cpptools/cppsourceprocessor.cpp index 2259b01f78..35a0ccf529 100644 --- a/src/plugins/cpptools/cppsourceprocessor.cpp +++ b/src/plugins/cpptools/cppsourceprocessor.cpp @@ -56,7 +56,7 @@ using namespace CPlusPlus; using namespace CppTools; using namespace CppTools::Internal; -typedef Document::DiagnosticMessage Message; +using Message = Document::DiagnosticMessage; static Q_LOGGING_CATEGORY(log, "qtc.cpptools.sourceprocessor", QtWarningMsg) @@ -119,8 +119,7 @@ CppSourceProcessor::CppSourceProcessor(const Snapshot &snapshot, DocumentCallbac m_preprocess.setKeepComments(true); } -CppSourceProcessor::~CppSourceProcessor() -{ } +CppSourceProcessor::~CppSourceProcessor() = default; void CppSourceProcessor::setCancelChecker(const CppSourceProcessor::CancelChecker &cancelChecker) { @@ -135,10 +134,8 @@ void CppSourceProcessor::setHeaderPaths(const ProjectExplorer::HeaderPaths &head using ProjectExplorer::HeaderPathType; m_headerPaths.clear(); - for (int i = 0, ei = headerPaths.size(); i < ei; ++i) { - const ProjectExplorer::HeaderPath &path = headerPaths.at(i); - - if (path.type == HeaderPathType::Framework ) + for (const auto &path : headerPaths) { + if (path.type == HeaderPathType::Framework ) addFrameworkPath(path); else m_headerPaths.append({cleanPath(path.path), path.type}); |