ref-filter: get rid of goto
Get rid of goto command in ref-filter for better readability. Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Olga Telezhnaya committed
Feb 21, 2018 at 06:59 UTC
edfb8ba06822375b08796b7b4354a94d98b05d13
1 file changed
+3
-3
ref-filter.c
+3
-3
@@ -1494,11 +1494,11 @@ static void populate_value(struct ref_array_item *ref)
1494
for (i = 0; i < used_atom_cnt; i++) {
1495
struct atom_value *v = &ref->value[i];
1496
if (v->s == NULL)
1497
- goto need_obj;
1497
+ break;
1498
}
1499
- return;
1499
+ if (used_atom_cnt <= i)
1500
+ return;
1501
1501
- need_obj:
1502
get_object(ref, &ref->objectname, 0, &obj);
1503
1504
/*