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

@@ -5,6 +5,7 @@
#pragma once
#include <functional>
#include <utility>
#include <vector>
#include <hal/Types.h>
@@ -102,7 +103,7 @@ class TimedRobot : public IterativeRobotBase, public ErrorBase {
*/
Callback(std::function<void()> func, units::second_t startTime,
units::second_t period, units::second_t offset)
: func{func},
: func{std::move(func)},
period{period},
expirationTime{
startTime + offset +

View File

@@ -41,9 +41,8 @@ class HolonomicDriveController {
* angle.
*/
HolonomicDriveController(
const frc2::PIDController& xController,
const frc2::PIDController& yController,
const ProfiledPIDController<units::radian>& thetaController);
frc2::PIDController xController, frc2::PIDController yController,
ProfiledPIDController<units::radian> thetaController);
/**
* Returns true if the pose error is within tolerance of the reference.

View File

@@ -41,7 +41,7 @@ class DifferentialDrivetrainSim {
* starting point.
*/
DifferentialDrivetrainSim(
const LinearSystem<2, 2, 2>& plant, units::meter_t trackWidth,
LinearSystem<2, 2, 2> plant, units::meter_t trackWidth,
DCMotor driveMotor, double gearingRatio, units::meter_t wheelRadius,
const std::array<double, 7>& measurementStdDevs = {});