mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-27 13:21:17 -05:00
pack-objects: drop cast_size_t_to_ulong shims in get_delta()
The two shims that 606c192380 (odb, packfile: use size_t for
streaming object sizes, 2026-05-08) and the subsequent
odb_read_object() widening introduced as scaffolding around
get_delta()'s reads can now disappear: the previous commit widened
diff_delta() to size_t, which was the last narrow consumer in this
function.
Widen size and base_size to size_t outright, drop the size_st /
base_size_st bridging temporaries, and drop the two
cast_size_t_to_ulong() calls. Net change is 4 lines smaller and one
read-then-cast indirection gone from each odb read.
Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -353,21 +353,17 @@ static void index_commit_for_bitmap(struct commit *commit)
|
||||
|
||||
static void *get_delta(struct object_entry *entry)
|
||||
{
|
||||
unsigned long size, base_size;
|
||||
size_t delta_size;
|
||||
size_t size, base_size, delta_size;
|
||||
void *buf, *base_buf, *delta_buf;
|
||||
enum object_type type;
|
||||
size_t size_st = 0, base_size_st = 0;
|
||||
|
||||
buf = odb_read_object(the_repository->objects, &entry->idx.oid,
|
||||
&type, &size_st);
|
||||
size = cast_size_t_to_ulong(size_st);
|
||||
&type, &size);
|
||||
if (!buf)
|
||||
die(_("unable to read %s"), oid_to_hex(&entry->idx.oid));
|
||||
base_buf = odb_read_object(the_repository->objects,
|
||||
&DELTA(entry)->idx.oid, &type,
|
||||
&base_size_st);
|
||||
base_size = cast_size_t_to_ulong(base_size_st);
|
||||
&base_size);
|
||||
if (!base_buf)
|
||||
die("unable to read %s",
|
||||
oid_to_hex(&DELTA(entry)->idx.oid));
|
||||
|
||||
Reference in New Issue
Block a user