From 1d3d18a96988eb091b207103f18c9fbba505013a Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Mon, 14 Jan 2019 01:40:53 +0100 Subject: CppTools: modernize Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar Reviewed-by: Orgad Shaneh --- src/plugins/cpptools/cppsourceprocessor.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/plugins/cpptools/cppsourceprocessor.cpp') 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}); -- cgit v1.2.1