mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
clang-tidy: modernize-pass-by-value
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#define WPIUTIL_WPI_LOGGER_H_
|
||||
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/SmallString.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
@@ -30,9 +31,9 @@ class Logger {
|
||||
unsigned int line, const char* msg)>;
|
||||
|
||||
Logger() = default;
|
||||
explicit Logger(const LogFunc& func) : m_func(func) {}
|
||||
Logger(const LogFunc& func, unsigned int min_level)
|
||||
: m_func(func), m_min_level(min_level) {}
|
||||
explicit Logger(LogFunc func) : m_func(std::move(func)) {}
|
||||
Logger(LogFunc func, unsigned int min_level)
|
||||
: m_func(std::move(func)), m_min_level(min_level) {}
|
||||
|
||||
void SetLogger(LogFunc func) { m_func = func; }
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class WebSocketServer : public std::enable_shared_from_this<WebSocketServer> {
|
||||
* Private constructor.
|
||||
*/
|
||||
WebSocketServer(uv::Stream& stream, ArrayRef<StringRef> protocols,
|
||||
const ServerOptions& options, const private_init&);
|
||||
ServerOptions options, const private_init&);
|
||||
|
||||
/**
|
||||
* Starts a dedicated WebSocket server on the provided connection. The
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#ifndef WPIUTIL_WPI_RAW_UV_OSTREAM_H_
|
||||
#define WPIUTIL_WPI_RAW_UV_OSTREAM_H_
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "wpi/ArrayRef.h"
|
||||
#include "wpi/SmallVector.h"
|
||||
#include "wpi/raw_ostream.h"
|
||||
@@ -38,7 +40,7 @@ class raw_uv_ostream : public raw_ostream {
|
||||
*/
|
||||
raw_uv_ostream(SmallVectorImpl<uv::Buffer>& bufs,
|
||||
std::function<uv::Buffer()> alloc)
|
||||
: m_bufs(bufs), m_alloc(alloc) {
|
||||
: m_bufs(bufs), m_alloc(std::move(alloc)) {
|
||||
SetUnbuffered();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user