mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
comply with Firmware style requirements
This commit is contained in:
parent
f981cea2ae
commit
25c0455348
@ -26,10 +26,13 @@ private:
|
||||
static constexpr size_t _indices[N] {Idxs...};
|
||||
|
||||
static constexpr bool duplicateIndices() {
|
||||
for (size_t i = 0; i < N; i++)
|
||||
for (size_t j = 0; j < i; j++)
|
||||
if (_indices[i] == _indices[j])
|
||||
for (size_t i = 0; i < N; i++) {
|
||||
for (size_t j = 0; j < i; j++) {
|
||||
if (_indices[i] == _indices[j]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static constexpr size_t findMaxIndex() {
|
||||
@ -42,7 +45,7 @@ private:
|
||||
return maxIndex;
|
||||
}
|
||||
|
||||
static_assert(duplicateIndices() == false, "Duplicate indices");
|
||||
static_assert(!duplicateIndices(), "Duplicate indices");
|
||||
static_assert(N < M, "More entries than elements, use a dense vector");
|
||||
static_assert(N > 0, "A sparse vector needs at least one element");
|
||||
static_assert(findMaxIndex() < M, "Largest entry doesn't fit in sparse vector");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user