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:
Rémi Verschelde 2020-05-14 16:41:43 +02:00
parent 07bc4e2f96
commit 0ee0fa42e6
683 changed files with 22803 additions and 12225 deletions

View file

@ -84,8 +84,9 @@ void EditorDebuggerTree::_scene_tree_folded(Object *p_obj) {
}
TreeItem *item = Object::cast_to<TreeItem>(p_obj);
if (!item)
if (!item) {
return;
}
ObjectID id = ObjectID(uint64_t(item->get_metadata(0)));
if (unfold_cache.has(id)) {
@ -97,8 +98,9 @@ void EditorDebuggerTree::_scene_tree_folded(Object *p_obj) {
void EditorDebuggerTree::_scene_tree_rmb_selected(const Vector2 &p_position) {
TreeItem *item = get_item_at_position(p_position);
if (!item)
if (!item) {
return;
}
item->select(0);
@ -176,12 +178,14 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
// Apply filters.
while (parent) {
const bool had_siblings = item->get_prev() || item->get_next();
if (filter.is_subsequence_ofi(item->get_text(0)))
if (filter.is_subsequence_ofi(item->get_text(0))) {
break; // Filter matches, must survive.
}
parent->remove_child(item);
memdelete(item);
if (had_siblings)
if (had_siblings) {
break; // Parent must survive.
}
item = parent;
parent = item->get_parent();
// Check if parent expects more children.
@ -199,8 +203,9 @@ void EditorDebuggerTree::update_scene_tree(const SceneDebuggerTree *p_tree, int
}
String EditorDebuggerTree::get_selected_path() {
if (!get_selected())
if (!get_selected()) {
return "";
}
return _get_path(get_selected());
}
@ -256,7 +261,8 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) {
}
void EditorDebuggerTree::_file_selected(const String &p_file) {
if (inspected_object_id.is_null())
if (inspected_object_id.is_null()) {
return;
}
emit_signal("save_node", inspected_object_id, p_file, debugger_id);
}