mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
clang-tidy: modernize-pass-by-value
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ struct ConnectionInfo {
|
||||
struct RpcParamDef {
|
||||
RpcParamDef() = default;
|
||||
RpcParamDef(StringRef name_, std::shared_ptr<Value> def_value_)
|
||||
: name(name_), def_value(def_value_) {}
|
||||
: name(name_), def_value(std::move(def_value_)) {}
|
||||
|
||||
std::string name;
|
||||
std::shared_ptr<Value> def_value;
|
||||
@@ -132,8 +132,12 @@ class RpcAnswer {
|
||||
public:
|
||||
RpcAnswer() = default;
|
||||
RpcAnswer(NT_Entry entry_, NT_RpcCall call_, StringRef name_,
|
||||
StringRef params_, const ConnectionInfo& conn_)
|
||||
: entry(entry_), call(call_), name(name_), params(params_), conn(conn_) {}
|
||||
StringRef params_, ConnectionInfo conn_)
|
||||
: entry(entry_),
|
||||
call(call_),
|
||||
name(name_),
|
||||
params(params_),
|
||||
conn(std::move(conn_)) {}
|
||||
|
||||
/** Entry handle. */
|
||||
NT_Entry entry{0};
|
||||
@@ -183,7 +187,7 @@ class EntryNotification {
|
||||
: listener(listener_),
|
||||
entry(entry_),
|
||||
name(name_),
|
||||
value(value_),
|
||||
value(std::move(value_)),
|
||||
flags(flags_) {}
|
||||
|
||||
/** Listener that was triggered. */
|
||||
@@ -219,8 +223,8 @@ class ConnectionNotification {
|
||||
public:
|
||||
ConnectionNotification() = default;
|
||||
ConnectionNotification(NT_ConnectionListener listener_, bool connected_,
|
||||
const ConnectionInfo& conn_)
|
||||
: listener(listener_), connected(connected_), conn(conn_) {}
|
||||
ConnectionInfo conn_)
|
||||
: listener(listener_), connected(connected_), conn(std::move(conn_)) {}
|
||||
|
||||
/** Listener that was triggered. */
|
||||
NT_ConnectionListener listener{0};
|
||||
|
||||
Reference in New Issue
Block a user