@matheusbsbs / matheus-bagliano / commits / fc968e26c2
Fork 0

index-pack: remove redundant parameter

find_{ref,ofs}_delta_{,children} take an enum object_type parameter, but the object type is already present in the name of the function. Remove that parameter from these functions. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Aug 24, 2020 at 12:16 UTC fc968e26c201a63d4d75cae550ecf0447c82920f
1 file changed +12 -14
builtin/index-pack.c
+12 -14
@@ -614,7 +614,7 @@ static int compare_ofs_delta_bases(off_t offset1, off_t offset2,
614 0;
615 }
616
617 -static int find_ofs_delta(const off_t offset, enum object_type type)
617 +static int find_ofs_delta(const off_t offset)
618 {
619 int first = 0, last = nr_ofs_deltas;
620
@@ -624,7 +624,8 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
624 int cmp;
625
626 cmp = compare_ofs_delta_bases(offset, delta->offset,
627 - type, objects[delta->obj_no].type);
627 + OBJ_OFS_DELTA,
628 + objects[delta->obj_no].type);
629 if (!cmp)
630 return next;
631 if (cmp < 0) {
@@ -637,10 +638,9 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
638 }
639
640 static void find_ofs_delta_children(off_t offset,
640 - int *first_index, int *last_index,
641 - enum object_type type)
641 + int *first_index, int *last_index)
642 {
643 - int first = find_ofs_delta(offset, type);
643 + int first = find_ofs_delta(offset);
644 int last = first;
645 int end = nr_ofs_deltas - 1;
646
@@ -668,7 +668,7 @@ static int compare_ref_delta_bases(const struct object_id *oid1,
668 return oidcmp(oid1, oid2);
669 }
670
671 -static int find_ref_delta(const struct object_id *oid, enum object_type type)
671 +static int find_ref_delta(const struct object_id *oid)
672 {
673 int first = 0, last = nr_ref_deltas;
674
@@ -678,7 +678,8 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
678 int cmp;
679
680 cmp = compare_ref_delta_bases(oid, &delta->oid,
681 - type, objects[delta->obj_no].type);
681 + OBJ_REF_DELTA,
682 + objects[delta->obj_no].type);
683 if (!cmp)
684 return next;
685 if (cmp < 0) {
@@ -691,10 +692,9 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
692 }
693
694 static void find_ref_delta_children(const struct object_id *oid,
694 - int *first_index, int *last_index,
695 - enum object_type type)
695 + int *first_index, int *last_index)
696 {
697 - int first = find_ref_delta(oid, type);
697 + int first = find_ref_delta(oid);
698 int last = first;
699 int end = nr_ref_deltas - 1;
700
@@ -983,12 +983,10 @@ static struct base_data *find_unresolved_deltas_1(struct base_data *base,
983 {
984 if (base->ref_last == -1 && base->ofs_last == -1) {
985 find_ref_delta_children(&base->obj->idx.oid,
986 - &base->ref_first, &base->ref_last,
987 - OBJ_REF_DELTA);
986 + &base->ref_first, &base->ref_last);
987
988 find_ofs_delta_children(base->obj->idx.offset,
990 - &base->ofs_first, &base->ofs_last,
991 - OBJ_OFS_DELTA);
989 + &base->ofs_first, &base->ofs_last);
990
991 if (base->ref_last == -1 && base->ofs_last == -1) {
992 free(base->data);