You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
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:
@@ -82,8 +82,9 @@ public:
|
||||
|
||||
struct ItemPtrSort {
|
||||
_FORCE_INLINE_ bool operator()(const Item *p_left, const Item *p_right) const {
|
||||
if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y))
|
||||
if (Math::is_equal_approx(p_left->ysort_pos.y, p_right->ysort_pos.y)) {
|
||||
return p_left->ysort_pos.x < p_right->ysort_pos.x;
|
||||
}
|
||||
|
||||
return p_left->ysort_pos.y < p_right->ysort_pos.y;
|
||||
}
|
||||
@@ -128,15 +129,17 @@ public:
|
||||
|
||||
int find_item(Item *p_item) {
|
||||
for (int i = 0; i < child_items.size(); i++) {
|
||||
if (child_items[i].item == p_item)
|
||||
if (child_items[i].item == p_item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void erase_item(Item *p_item) {
|
||||
int idx = find_item(p_item);
|
||||
if (idx >= 0)
|
||||
if (idx >= 0) {
|
||||
child_items.remove(idx);
|
||||
}
|
||||
}
|
||||
|
||||
Canvas() {
|
||||
|
||||
Reference in New Issue
Block a user