From e18ebd839834cdb4c63b1d0ebe9c48fa607bdffa Mon Sep 17 00:00:00 2001 From: Sergei Shirokov Date: Wed, 8 May 2024 17:17:36 +0300 Subject: [PATCH] Use of a potentially moved-from object #sonar (cpp:M23_280)[https://sonarcloud.io/organizations/opencyphal-garage/rules?open=cpp%3AM23_280&rule_key=cpp%3AM23_280] --- include/libcyphal/transport/can/delegate.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/libcyphal/transport/can/delegate.hpp b/include/libcyphal/transport/can/delegate.hpp index 580c28f39..ff2d0cf0d 100644 --- a/include/libcyphal/transport/can/delegate.hpp +++ b/include/libcyphal/transport/can/delegate.hpp @@ -135,7 +135,7 @@ class TransportDelegate /// @return Total count of visited nodes (including the `node` one). `0` if `node` is `nullptr`. /// template - static std::size_t visitCounting(CanardTreeNode* const node, Visitor&& visitor) // NOLINT(misc-no-recursion) + static std::size_t visitCounting(CanardTreeNode* const node, const Visitor& visitor) // NOLINT(misc-no-recursion) { if (node == nullptr) { @@ -145,11 +145,11 @@ class TransportDelegate // Initial `1` is for the current node. std::size_t count = 1; - count += visitCounting(node->lr[0], std::forward(visitor)); - // Next nolint & nosonar are unavoidable: this is integration with low-level C code of Canard AVL trees. + count += visitCounting(node->lr[0], visitor); + // Next nolint & NOSONAR are unavoidable: this is integration with low-level C code of Canard AVL trees. // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) visitor(*reinterpret_cast(node)); // NOSONAR - count += visitCounting(node->lr[1], std::forward(visitor)); + count += visitCounting(node->lr[1], visitor); return count; }