mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +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:
@@ -31,7 +31,8 @@ auto SendableChooser<T>::GetSelected()
|
||||
std::string selected = m_defaultChoice;
|
||||
{
|
||||
std::scoped_lock lock(m_mutex);
|
||||
if (m_haveSelected) selected = m_selected;
|
||||
if (m_haveSelected)
|
||||
selected = m_selected;
|
||||
}
|
||||
if (selected.empty()) {
|
||||
return decltype(_unwrap_smart_ptr(m_choices[""])){};
|
||||
@@ -85,7 +86,8 @@ void SendableChooser<T>::InitSendable(SendableBuilder& builder) {
|
||||
std::scoped_lock lock(m_mutex);
|
||||
m_haveSelected = true;
|
||||
m_selected = val;
|
||||
for (auto& entry : m_activeEntries) entry.SetString(val);
|
||||
for (auto& entry : m_activeEntries)
|
||||
entry.SetString(val);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user