clang-tidy: modernize-pass-by-value

This commit is contained in:
Peter Johnson
2020-12-28 10:12:52 -08:00
parent 29c7da5f1a
commit aee4603269
32 changed files with 158 additions and 107 deletions

View File

@@ -4,6 +4,8 @@
#include "NetworkConnection.h"
#include <utility>
#include <wpi/NetworkStream.h>
#include <wpi/raw_socket_istream.h>
#include <wpi/timestamp.h>
@@ -25,8 +27,8 @@ NetworkConnection::NetworkConnection(unsigned int uid,
m_stream(std::move(stream)),
m_notifier(notifier),
m_logger(logger),
m_handshake(handshake),
m_get_entry_type(get_entry_type),
m_handshake(std::move(handshake)),
m_get_entry_type(std::move(get_entry_type)),
m_state(kCreated) {
m_active = false;
m_proto_rev = 0x0300;

View File

@@ -26,7 +26,7 @@ struct RpcNotifierData : public RpcAnswer {
StringRef params_, const ConnectionInfo& conn_,
IRpcServer::SendResponseFunc send_response_)
: RpcAnswer{entry_, call_, name_, params_, conn_},
send_response{send_response_} {}
send_response{std::move(send_response_)} {}
IRpcServer::SendResponseFunc send_response;
};

View File

@@ -4,6 +4,7 @@
#include <cctype>
#include <string>
#include <utility>
#include <wpi/Base64.h>
#include <wpi/SmallString.h>
@@ -24,7 +25,7 @@ class LoadPersistentImpl {
using WarnFunc = std::function<void(size_t, const char*)>;
LoadPersistentImpl(wpi::raw_istream& is, WarnFunc warn)
: m_is(is), m_warn(warn) {}
: m_is(is), m_warn(std::move(warn)) {}
bool Load(StringRef prefix, std::vector<Entry>* entries);