Skip to content

Commit f2c40e5

Browse files
pks-tgitster
authored andcommitted
object-file: inline for_each_loose_file_in_objdir_buf()
The function `for_each_loose_file_in_objdir_buf()` is declared in our headers, but it is not used anywhere else than in the corresponding code file itself. Drop the declaration and inline the function into its only caller. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e7e952f commit f2c40e5

File tree

2 files changed

+8
-28
lines changed

2 files changed

+8
-28
lines changed

object-file.c

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,26 +1388,6 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr,
13881388
return r;
13891389
}
13901390

1391-
int for_each_loose_file_in_objdir_buf(struct strbuf *path,
1392-
each_loose_object_fn obj_cb,
1393-
each_loose_cruft_fn cruft_cb,
1394-
each_loose_subdir_fn subdir_cb,
1395-
void *data)
1396-
{
1397-
int r = 0;
1398-
int i;
1399-
1400-
for (i = 0; i < 256; i++) {
1401-
r = for_each_file_in_obj_subdir(i, path, the_repository->hash_algo,
1402-
obj_cb, cruft_cb,
1403-
subdir_cb, data);
1404-
if (r)
1405-
break;
1406-
}
1407-
1408-
return r;
1409-
}
1410-
14111391
int for_each_loose_file_in_objdir(const char *path,
14121392
each_loose_object_fn obj_cb,
14131393
each_loose_cruft_fn cruft_cb,
@@ -1418,10 +1398,15 @@ int for_each_loose_file_in_objdir(const char *path,
14181398
int r;
14191399

14201400
strbuf_addstr(&buf, path);
1421-
r = for_each_loose_file_in_objdir_buf(&buf, obj_cb, cruft_cb,
1422-
subdir_cb, data);
1423-
strbuf_release(&buf);
1401+
for (int i = 0; i < 256; i++) {
1402+
r = for_each_file_in_obj_subdir(i, &buf, the_repository->hash_algo,
1403+
obj_cb, cruft_cb,
1404+
subdir_cb, data);
1405+
if (r)
1406+
break;
1407+
}
14241408

1409+
strbuf_release(&buf);
14251410
return r;
14261411
}
14271412

object-file.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ int for_each_loose_file_in_objdir(const char *path,
9898
each_loose_cruft_fn cruft_cb,
9999
each_loose_subdir_fn subdir_cb,
100100
void *data);
101-
int for_each_loose_file_in_objdir_buf(struct strbuf *path,
102-
each_loose_object_fn obj_cb,
103-
each_loose_cruft_fn cruft_cb,
104-
each_loose_subdir_fn subdir_cb,
105-
void *data);
106101

107102
/*
108103
* Iterate over all accessible loose objects without respect to

0 commit comments

Comments
 (0)