mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
clang-tidy: modernize-pass-by-value
This commit is contained in:
@@ -4,11 +4,15 @@
|
||||
|
||||
#include "commands/TankDrive.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "Robot.h"
|
||||
|
||||
TankDrive::TankDrive(std::function<double()> left,
|
||||
std::function<double()> right, DriveTrain* drivetrain)
|
||||
: m_left(left), m_right(right), m_drivetrain(drivetrain) {
|
||||
: m_left(std::move(left)),
|
||||
m_right(std::move(right)),
|
||||
m_drivetrain(drivetrain) {
|
||||
SetName("TankDrive");
|
||||
AddRequirements({m_drivetrain});
|
||||
}
|
||||
|
||||
@@ -4,10 +4,14 @@
|
||||
|
||||
#include "commands/DefaultDrive.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
DefaultDrive::DefaultDrive(DriveSubsystem* subsystem,
|
||||
std::function<double()> forward,
|
||||
std::function<double()> rotation)
|
||||
: m_drive{subsystem}, m_forward{forward}, m_rotation{rotation} {
|
||||
: m_drive{subsystem},
|
||||
m_forward{std::move(forward)},
|
||||
m_rotation{std::move(rotation)} {
|
||||
AddRequirements({subsystem});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user