summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppcheckdiagnostic.cpp
blob: d16c7b06e2961868d8142fe025abb226707f28c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright (C) 2019 Sergey Morozov
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include "cppcheckdiagnostic.h"

namespace Cppcheck::Internal {

bool Diagnostic::operator==(const Diagnostic &r) const
{
    return std::tie(severity, message, fileName, lineNumber)
           == std::tie(r.severity, r.message, r.fileName, r.lineNumber);
}

size_t qHash(const Diagnostic &diagnostic)
{
    return qHash(diagnostic.message) ^ qHash(diagnostic.fileName) ^ diagnostic.lineNumber;
}

} // namespace Cppcheck