mirror of
https://github.com/XRPLF/rippled.git
synced 2026-10-02 09:48:04 +00:00
refactor(telemetry): replace unused-parameter casts with maybe_unused
setNodeId() and Counter::add() silenced an unused parameter with a (void) cast in their telemetry-disabled arm. The attribute is this codebase's idiom: it appears 105 times across 40 files on develop. Parameter names stay, because the enabled arm uses them and the @param lines name them. totalAgreementsEver() and totalMissedEver() are pure accessors and gain [[nodiscard]]; no caller discards either.
This commit is contained in:
@@ -174,12 +174,10 @@ public:
|
||||
* @param n How much to add; defaults to 1.
|
||||
*/
|
||||
void
|
||||
add(T const n = 1) noexcept
|
||||
add([[maybe_unused]] T const n = 1) noexcept
|
||||
{
|
||||
#ifdef XRPL_ENABLE_TELEMETRY
|
||||
value_.fetch_add(n, std::memory_order_relaxed);
|
||||
#else
|
||||
(void)n;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -336,10 +336,9 @@ public:
|
||||
* @param id The node's base58-encoded public key.
|
||||
*/
|
||||
virtual void
|
||||
setNodeId(std::string const& id)
|
||||
setNodeId([[maybe_unused]] std::string const& id)
|
||||
{
|
||||
// Default no-op for NullTelemetry implementations.
|
||||
(void)id;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -226,7 +226,7 @@ public:
|
||||
* counter validation_agreements_total. See the counting-semantics
|
||||
* note in detail/ValidationTracker.cpp.
|
||||
*/
|
||||
uint64_t
|
||||
[[nodiscard]] uint64_t
|
||||
totalAgreementsEver() const;
|
||||
|
||||
/**
|
||||
@@ -238,7 +238,7 @@ public:
|
||||
* counter validation_missed_total. See the counting-semantics note
|
||||
* in detail/ValidationTracker.cpp.
|
||||
*/
|
||||
uint64_t
|
||||
[[nodiscard]] uint64_t
|
||||
totalMissedEver() const;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user