Skip to content

Commit

Permalink
silence clang-tidy warning and simplify enum
Browse files Browse the repository at this point in the history
The warning is plain wrong, the function isn't detected by qt if it is
in an anonymous namespace and it is used.
Enum automatically counts up so there is no need to manually set these
values.
  • Loading branch information
lievenhey committed Sep 29, 2023
1 parent b8dc4a1 commit 7cbf92c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/models/eventmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

#include <QSet>

static bool operator<(const EventModel::Process& process, qint32 pid)
// silence clang warnings
// NOLINTNEXTLINE(misc-use-anonymous-namespace)
[[maybe_unused]] static bool operator<(const EventModel::Process& process, qint32 pid)
{
return process.pid < pid;
}
Expand All @@ -21,12 +23,12 @@ namespace {
enum class Tag : quint8
{
Invalid = 0,
Root = 1,
Overview = 2,
Cpus = 3,
Processes = 4,
Threads = 5,
Tracepoints = 6,
Root,
Overview,
Cpus,
Processes,
Threads,
Tracepoints,
};

enum OverViewRow : quint8
Expand Down

0 comments on commit 7cbf92c

Please sign in to comment.