Skip to content

Commit fc968e2

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 009be0d commit fc968e2

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

builtin/index-pack.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int compare_ofs_delta_bases(off_t offset1, off_t offset2,
614614
0;
615615
}
616616

617-
static int find_ofs_delta(const off_t offset, enum object_type type)
617+
static int find_ofs_delta(const off_t offset)
618618
{
619619
int first = 0, last = nr_ofs_deltas;
620620

@@ -624,7 +624,8 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
624624
int cmp;
625625

626626
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);
628629
if (!cmp)
629630
return next;
630631
if (cmp < 0) {
@@ -637,10 +638,9 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
637638
}
638639

639640
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)
642642
{
643-
int first = find_ofs_delta(offset, type);
643+
int first = find_ofs_delta(offset);
644644
int last = first;
645645
int end = nr_ofs_deltas - 1;
646646

@@ -668,7 +668,7 @@ static int compare_ref_delta_bases(const struct object_id *oid1,
668668
return oidcmp(oid1, oid2);
669669
}
670670

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)
672672
{
673673
int first = 0, last = nr_ref_deltas;
674674

@@ -678,7 +678,8 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
678678
int cmp;
679679

680680
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);
682683
if (!cmp)
683684
return next;
684685
if (cmp < 0) {
@@ -691,10 +692,9 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
691692
}
692693

693694
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)
696696
{
697-
int first = find_ref_delta(oid, type);
697+
int first = find_ref_delta(oid);
698698
int last = first;
699699
int end = nr_ref_deltas - 1;
700700

@@ -983,12 +983,10 @@ static struct base_data *find_unresolved_deltas_1(struct base_data *base,
983983
{
984984
if (base->ref_last == -1 && base->ofs_last == -1) {
985985
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);
988987

989988
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);
992990

993991
if (base->ref_last == -1 && base->ofs_last == -1) {
994992
free(base->data);

0 commit comments

Comments
 (0)