aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/cppcheck/cppchecktextmarkmanager.cpp
diff options
context:
space:
mode:
authorOrgad Shaneh <[email protected]>2018-09-25 21:08:52 +0300
committerOrgad Shaneh <[email protected]>2018-09-26 10:02:32 +0000
commit7f2bbe9cfb337a6d6c6dc7ef68d86d320006e2ee (patch)
treef19209625ef3a669fa7253833d1d1ec17f51f64f /src/plugins/cppcheck/cppchecktextmarkmanager.cpp
parent9644745b3d9d914e75dd8285e9d0a74a161fad4c (diff)
Cppcheck: Reduce uses of auto
Conform to coding rules. Change-Id: I57600bd450665d5db87710bb2444e39e7ecbf3e3 Reviewed-by: Nikolai Kosjar <[email protected]>
Diffstat (limited to 'src/plugins/cppcheck/cppchecktextmarkmanager.cpp')
-rw-r--r--src/plugins/cppcheck/cppchecktextmarkmanager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/cppcheck/cppchecktextmarkmanager.cpp b/src/plugins/cppcheck/cppchecktextmarkmanager.cpp
index df2ffe3cee0..2d19a221513 100644
--- a/src/plugins/cppcheck/cppchecktextmarkmanager.cpp
+++ b/src/plugins/cppcheck/cppchecktextmarkmanager.cpp
@@ -38,9 +38,8 @@ CppcheckTextMarkManager::~CppcheckTextMarkManager() = default;
void CppcheckTextMarkManager::add(const Diagnostic &diagnostic)
{
- auto &fileMarks = m_marks[diagnostic.fileName];
- const auto finder = [diagnostic] (const MarkPtr &mark) {return *mark == diagnostic;};
- if (Utils::contains(fileMarks, finder))
+ std::vector<MarkPtr> &fileMarks = m_marks[diagnostic.fileName];
+ if (Utils::contains(fileMarks, [diagnostic](const MarkPtr &mark) {return *mark == diagnostic;}))
return;
fileMarks.push_back(std::make_unique<CppcheckTextMark>(diagnostic));
@@ -52,7 +51,7 @@ void CppcheckTextMarkManager::clearFiles(const Utils::FileNameList &files)
return;
if (!files.empty()) {
- for (const auto &file: files)
+ for (const Utils::FileName &file : files)
m_marks.erase(file);
} else {
m_marks.clear();