Remove redundant C++ lambda parentheses (NFC) (#3433)

This commit is contained in:
Tyler Veness
2021-06-12 08:06:45 -07:00
committed by GitHub
parent f60994ad24
commit 04e64db945
37 changed files with 63 additions and 64 deletions

View File

@@ -295,10 +295,10 @@ void Command::SetSubsystem(std::string_view name) {
void Command::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Command");
builder.AddStringProperty(
".name", [=]() { return SendableRegistry::GetInstance().GetName(this); },
".name", [=] { return SendableRegistry::GetInstance().GetName(this); },
nullptr);
builder.AddBooleanProperty(
"running", [=]() { return IsRunning(); },
"running", [=] { return IsRunning(); },
[=](bool value) {
if (value) {
if (!IsRunning()) {
@@ -311,5 +311,5 @@ void Command::InitSendable(SendableBuilder& builder) {
}
});
builder.AddBooleanProperty(
".isParented", [=]() { return IsParented(); }, nullptr);
".isParented", [=] { return IsParented(); }, nullptr);
}

View File

@@ -162,7 +162,7 @@ void Scheduler::InitSendable(SendableBuilder& builder) {
auto namesEntry = builder.GetEntry("Names");
auto idsEntry = builder.GetEntry("Ids");
auto cancelEntry = builder.GetEntry("Cancel");
builder.SetUpdateTable([=]() {
builder.SetUpdateTable([=] {
// Get the list of possible commands to cancel
auto new_toCancel = cancelEntry.GetValue();
wpi::span<const double> toCancel;

View File

@@ -125,12 +125,12 @@ void Subsystem::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Subsystem");
builder.AddBooleanProperty(
".hasDefault", [=]() { return m_defaultCommand != nullptr; }, nullptr);
".hasDefault", [=] { return m_defaultCommand != nullptr; }, nullptr);
builder.AddStringProperty(
".default", [=]() { return GetDefaultCommandName(); }, nullptr);
".default", [=] { return GetDefaultCommandName(); }, nullptr);
builder.AddBooleanProperty(
".hasCommand", [=]() { return m_currentCommand != nullptr; }, nullptr);
".hasCommand", [=] { return m_currentCommand != nullptr; }, nullptr);
builder.AddStringProperty(
".command", [=]() { return GetCurrentCommandName(); }, nullptr);
".command", [=] { return GetCurrentCommandName(); }, nullptr);
}