mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add braces to C++ single-line loops and conditionals (NFC) (#2973)
This makes code easier to read and more consistent between C++ and Java. Also update clang-format settings to always add a line break (even if no braces are used).
This commit is contained in:
@@ -26,7 +26,9 @@ NetworkTablesSettings::NetworkTablesSettings(NT_Inst inst,
|
||||
}
|
||||
|
||||
void NetworkTablesSettings::Update() {
|
||||
if (!m_restart) return;
|
||||
if (!m_restart) {
|
||||
return;
|
||||
}
|
||||
m_restart = false;
|
||||
nt::StopClient(m_inst);
|
||||
nt::StopServer(m_inst);
|
||||
@@ -40,8 +42,9 @@ void NetworkTablesSettings::Update() {
|
||||
wpi::SmallVector<wpi::StringRef, 4> serverNames;
|
||||
wpi::SmallVector<std::pair<wpi::StringRef, unsigned int>, 4> servers;
|
||||
serverTeam.split(serverNames, ',', -1, false);
|
||||
for (auto&& serverName : serverNames)
|
||||
for (auto&& serverName : serverNames) {
|
||||
servers.emplace_back(serverName, NT_DEFAULT_PORT);
|
||||
}
|
||||
nt::StartClient(m_inst, servers);
|
||||
}
|
||||
} else if (*m_pMode == 2) {
|
||||
@@ -64,5 +67,7 @@ void NetworkTablesSettings::Display() {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (ImGui::Button("Apply")) m_restart = true;
|
||||
if (ImGui::Button("Apply")) {
|
||||
m_restart = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user