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

#include "cppcheckdiagnostic.h"

namespace Cppcheck {
namespace 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 Internal
} // namespace Cppcheck