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; }