Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -103,8 +103,9 @@ void Gradient::set_offsets(const Vector<float> &p_offsets) {
|
||||
}
|
||||
|
||||
void Gradient::set_colors(const Vector<Color> &p_colors) {
|
||||
if (points.size() < p_colors.size())
|
||||
if (points.size() < p_colors.size()) {
|
||||
is_sorted = false;
|
||||
}
|
||||
points.resize(p_colors.size());
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
points.write[i].color = p_colors[i];
|
||||
@@ -141,8 +142,9 @@ void Gradient::set_points(Vector<Gradient::Point> &p_points) {
|
||||
|
||||
void Gradient::set_offset(int pos, const float offset) {
|
||||
ERR_FAIL_COND(pos < 0);
|
||||
if (points.size() <= pos)
|
||||
if (points.size() <= pos) {
|
||||
points.resize(pos + 1);
|
||||
}
|
||||
points.write[pos].offset = offset;
|
||||
is_sorted = false;
|
||||
emit_signal(CoreStringNames::get_singleton()->changed);
|
||||
|
||||
Reference in New Issue
Block a user