Skip to content

Commit fa23090

Browse files
ttaylorrgitster
authored andcommitted
builtin/pack-objects.c: return from create_object_entry()
A new caller in the next commit will want to immediately modify the object_entry structure created by create_object_entry(). Instead of forcing that caller to wastefully look-up the entry we just created, return it from create_object_entry() instead. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2bd4427 commit fa23090

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

builtin/pack-objects.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,13 +1516,13 @@ static int want_object_in_pack(const struct object_id *oid,
15161516
return 1;
15171517
}
15181518

1519-
static void create_object_entry(const struct object_id *oid,
1520-
enum object_type type,
1521-
uint32_t hash,
1522-
int exclude,
1523-
int no_try_delta,
1524-
struct packed_git *found_pack,
1525-
off_t found_offset)
1519+
static struct object_entry *create_object_entry(const struct object_id *oid,
1520+
enum object_type type,
1521+
uint32_t hash,
1522+
int exclude,
1523+
int no_try_delta,
1524+
struct packed_git *found_pack,
1525+
off_t found_offset)
15261526
{
15271527
struct object_entry *entry;
15281528

@@ -1539,6 +1539,8 @@ static void create_object_entry(const struct object_id *oid,
15391539
}
15401540

15411541
entry->no_try_delta = no_try_delta;
1542+
1543+
return entry;
15421544
}
15431545

15441546
static const char no_closure_warning[] = N_(

0 commit comments

Comments
 (0)