ref-filter: get rid of goto
authorOlga Telezhnaya <olyatelezhnaya@gmail.com>
Wed, 21 Feb 2018 06:59:01 +0000 (06:59 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Feb 2018 17:34:07 +0000 (09:34 -0800)
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>
ref-filter.c
index 25708704391a5a9f07bbfe97a03f339e3f8ee57f..be94766f78cc000249f4bea8908662a213b412d4 100644 (file)
@@ -1494,11 +1494,11 @@ static void populate_value(struct ref_array_item *ref)
        for (i = 0; i < used_atom_cnt; i++) {
                struct atom_value *v = &ref->value[i];
                if (v->s == NULL)
-                       goto need_obj;
+                       break;
        }
-       return;
+       if (used_atom_cnt <= i)
+               return;
 
- need_obj:
        get_object(ref, &ref->objectname, 0, &obj);
 
        /*