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>
This commit is contained in:
Jonathan Tan 2020-08-24 12:16:33 -07:00 коммит произвёл Junio C Hamano
Родитель 009be0d26d
Коммит fc968e26c2
1 изменённых файлов: 12 добавлений и 14 удалений

Просмотреть файл

@ -614,7 +614,7 @@ static int compare_ofs_delta_bases(off_t offset1, off_t offset2,
0; 0;
} }
static int find_ofs_delta(const off_t offset, enum object_type type) static int find_ofs_delta(const off_t offset)
{ {
int first = 0, last = nr_ofs_deltas; int first = 0, last = nr_ofs_deltas;
@ -624,7 +624,8 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
int cmp; int cmp;
cmp = compare_ofs_delta_bases(offset, delta->offset, cmp = compare_ofs_delta_bases(offset, delta->offset,
type, objects[delta->obj_no].type); OBJ_OFS_DELTA,
objects[delta->obj_no].type);
if (!cmp) if (!cmp)
return next; return next;
if (cmp < 0) { if (cmp < 0) {
@ -637,10 +638,9 @@ static int find_ofs_delta(const off_t offset, enum object_type type)
} }
static void find_ofs_delta_children(off_t offset, static void find_ofs_delta_children(off_t offset,
int *first_index, int *last_index, int *first_index, int *last_index)
enum object_type type)
{ {
int first = find_ofs_delta(offset, type); int first = find_ofs_delta(offset);
int last = first; int last = first;
int end = nr_ofs_deltas - 1; int end = nr_ofs_deltas - 1;
@ -668,7 +668,7 @@ static int compare_ref_delta_bases(const struct object_id *oid1,
return oidcmp(oid1, oid2); return oidcmp(oid1, oid2);
} }
static int find_ref_delta(const struct object_id *oid, enum object_type type) static int find_ref_delta(const struct object_id *oid)
{ {
int first = 0, last = nr_ref_deltas; int first = 0, last = nr_ref_deltas;
@ -678,7 +678,8 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
int cmp; int cmp;
cmp = compare_ref_delta_bases(oid, &delta->oid, cmp = compare_ref_delta_bases(oid, &delta->oid,
type, objects[delta->obj_no].type); OBJ_REF_DELTA,
objects[delta->obj_no].type);
if (!cmp) if (!cmp)
return next; return next;
if (cmp < 0) { if (cmp < 0) {
@ -691,10 +692,9 @@ static int find_ref_delta(const struct object_id *oid, enum object_type type)
} }
static void find_ref_delta_children(const struct object_id *oid, static void find_ref_delta_children(const struct object_id *oid,
int *first_index, int *last_index, int *first_index, int *last_index)
enum object_type type)
{ {
int first = find_ref_delta(oid, type); int first = find_ref_delta(oid);
int last = first; int last = first;
int end = nr_ref_deltas - 1; int end = nr_ref_deltas - 1;
@ -983,12 +983,10 @@ static struct base_data *find_unresolved_deltas_1(struct base_data *base,
{ {
if (base->ref_last == -1 && base->ofs_last == -1) { if (base->ref_last == -1 && base->ofs_last == -1) {
find_ref_delta_children(&base->obj->idx.oid, find_ref_delta_children(&base->obj->idx.oid,
&base->ref_first, &base->ref_last, &base->ref_first, &base->ref_last);
OBJ_REF_DELTA);
find_ofs_delta_children(base->obj->idx.offset, find_ofs_delta_children(base->obj->idx.offset,
&base->ofs_first, &base->ofs_last, &base->ofs_first, &base->ofs_last);
OBJ_OFS_DELTA);
if (base->ref_last == -1 && base->ofs_last == -1) { if (base->ref_last == -1 && base->ofs_last == -1) {
free(base->data); free(base->data);