mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41: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:
@@ -41,7 +41,9 @@ void AddressableLEDData::SetData(const HAL_AddressableLEDData* d, int32_t len) {
|
||||
int32_t AddressableLEDData::GetData(HAL_AddressableLEDData* d) {
|
||||
std::scoped_lock lock(m_dataMutex);
|
||||
int32_t len = length;
|
||||
if (d) std::memcpy(d, m_data, len * sizeof(d[0]));
|
||||
if (d) {
|
||||
std::memcpy(d, m_data, len * sizeof(d[0]));
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -50,8 +52,9 @@ extern "C" {
|
||||
int32_t HALSIM_FindAddressableLEDForChannel(int32_t channel) {
|
||||
for (int i = 0; i < kNumAddressableLEDs; ++i) {
|
||||
if (SimAddressableLEDData[i].initialized &&
|
||||
SimAddressableLEDData[i].outputPort == channel)
|
||||
SimAddressableLEDData[i].outputPort == channel) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user