From f98cdcb3574ee661223e1a09e1762b2cc85fab2f Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Thu, 29 Jul 2021 17:47:15 +0200 Subject: [PATCH] net: pass Span by value to CaptureMessage() Span is lightweight and need not be passed by const reference. --- src/net.cpp | 4 ++-- src/net.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index b31b618eea1..d35120794b9 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -3087,7 +3087,7 @@ uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const void CaptureMessageToFile(const CAddress& addr, const std::string& msg_type, - const Span& data, + Span data, bool is_incoming) { // Note: This function captures the message at the time of processing, @@ -3118,6 +3118,6 @@ void CaptureMessageToFile(const CAddress& addr, std::function& data, + Span data, bool is_incoming)> CaptureMessage = CaptureMessageToFile; diff --git a/src/net.h b/src/net.h index 23254e64458..ddc1d3dd7c1 100644 --- a/src/net.h +++ b/src/net.h @@ -1275,13 +1275,13 @@ private: /** Dump binary message to file, with timestamp */ void CaptureMessageToFile(const CAddress& addr, const std::string& msg_type, - const Span& data, + Span data, bool is_incoming); /** Defaults to `CaptureMessageToFile()`, but can be overridden by unit tests. */ extern std::function& data, + Span data, bool is_incoming)> CaptureMessage;