tog's view_set_child() never returned an error; simplify accordingly ok naddy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
diff --git a/tog/tog.c b/tog/tog.c
index 19f8a05..93cab5b 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -713,14 +713,11 @@ view_close_child(struct tog_view *view)
return err;
}
-static const struct got_error *
+static void
view_set_child(struct tog_view *view, struct tog_view *child)
{
- const struct got_error *err = NULL;
-
view->child = child;
child->parent = view;
- return err;
}
static int
@@ -2430,11 +2427,7 @@ input_log_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, diff_view);
- if (err) {
- view_close(diff_view);
- break;
- }
+ view_set_child(view, diff_view);
*focus_view = diff_view;
} else
*new_view = diff_view;
@@ -2452,11 +2445,7 @@ input_log_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, tree_view);
- if (err) {
- view_close(tree_view);
- break;
- }
+ view_set_child(view, tree_view);
*focus_view = tree_view;
} else
*new_view = tree_view;
@@ -2556,11 +2545,7 @@ input_log_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, ref_view);
- if (err) {
- view_close(ref_view);
- break;
- }
+ view_set_child(view, ref_view);
*focus_view = ref_view;
} else
*new_view = ref_view;
@@ -4600,11 +4585,7 @@ input_blame_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
break;
- err = view_set_child(view, diff_view);
- if (err) {
- view_close(diff_view);
- break;
- }
+ view_set_child(view, diff_view);
*focus_view = diff_view;
} else
*new_view = diff_view;
@@ -5306,11 +5287,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, log_view);
- if (err) {
- view_close(log_view);
- break;
- }
+ view_set_child(view, log_view);
*focus_view = log_view;
} else
*new_view = log_view;
@@ -5331,11 +5308,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, ref_view);
- if (err) {
- view_close(ref_view);
- break;
- }
+ view_set_child(view, ref_view);
*focus_view = ref_view;
} else
*new_view = ref_view;
@@ -5429,11 +5402,7 @@ input_tree_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, blame_view);
- if (err) {
- view_close(blame_view);
- break;
- }
+ view_set_child(view, blame_view);
*focus_view = blame_view;
} else
*new_view = blame_view;
@@ -6090,11 +6059,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, log_view);
- if (err) {
- view_close(log_view);
- break;
- }
+ view_set_child(view, log_view);
*focus_view = log_view;
} else
*new_view = log_view;
@@ -6112,11 +6077,7 @@ input_ref_view(struct tog_view **new_view, struct tog_view **dead_view,
err = view_close_child(view);
if (err)
return err;
- err = view_set_child(view, tree_view);
- if (err) {
- view_close(tree_view);
- break;
- }
+ view_set_child(view, tree_view);
*focus_view = tree_view;
} else
*new_view = tree_view;