Cppcheck: Reduce uses of auto

Conform to coding rules.

Change-Id: I57600bd450665d5db87710bb2444e39e7ecbf3e3
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Orgad Shaneh
2018-09-25 21:08:52 +03:00
committed by Orgad Shaneh
parent 9644745b3d
commit 7f2bbe9cfb
6 changed files with 51 additions and 55 deletions

View File

@@ -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();