reftable: remove unnecessary curly braces in reftable/tree.c
According to Documentation/CodingGuidelines, single-line control-flow statements must omit curly braces (except for some special cases). Make reftable/tree.c adhere to this guideline. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Chandra Pratap committed
Aug 4, 2024 at 19:36 UTC
e5a0f7076fcb2e9e6b3a8d125ac0e86420a96da1
1 file changed
+5
-10
reftable/tree.c
+5
-10
@@ -39,25 +39,20 @@ struct tree_node *tree_search(void *key, struct tree_node **rootp,
39
void infix_walk(struct tree_node *t, void (*action)(void *arg, void *key),
40
void *arg)
41
{
42
- if (t->left) {
42
+ if (t->left)
43
infix_walk(t->left, action, arg);
44
- }
44
action(arg, t->key);
46
- if (t->right) {
45
+ if (t->right)
46
infix_walk(t->right, action, arg);
48
- }
47
}
48
49
void tree_free(struct tree_node *t)
50
{
53
- if (!t) {
51
+ if (!t)
52
return;
55
- }
56
- if (t->left) {
53
+ if (t->left)
54
tree_free(t->left);
58
- }
59
- if (t->right) {
55
+ if (t->right)
56
tree_free(t->right);
61
- }
57
reftable_free(t);
58
}