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

@@ -7,6 +7,7 @@
#include <memory>
#include <ostream>
#include <utility>
#include "Message.h"
#include "TestPrinters.h"
@@ -18,7 +19,7 @@ class MessageMatcher
: public ::testing::MatcherInterface<std::shared_ptr<Message>> {
public:
explicit MessageMatcher(std::shared_ptr<Message> goodmsg_)
: goodmsg(goodmsg_) {}
: goodmsg(std::move(goodmsg_)) {}
bool MatchAndExplain(std::shared_ptr<Message> msg,
::testing::MatchResultListener* listener) const override;

View File

@@ -7,6 +7,7 @@
#include <memory>
#include <ostream>
#include <utility>
#include "gmock/gmock.h"
#include "networktables/NetworkTableValue.h"
@@ -16,7 +17,8 @@ namespace nt {
class ValueMatcher
: public ::testing::MatcherInterface<std::shared_ptr<Value>> {
public:
explicit ValueMatcher(std::shared_ptr<Value> goodval_) : goodval(goodval_) {}
explicit ValueMatcher(std::shared_ptr<Value> goodval_)
: goodval(std::move(goodval_)) {}
bool MatchAndExplain(std::shared_ptr<Value> msg,
::testing::MatchResultListener* listener) const override;