mirror of
https://github.com/git/git
synced 2024-10-14 12:32:43 +00:00
Merge branch 'ds/use-get-be64'
Code clean-up. * ds/use-get-be64: packfile: use get_be64() for large offsets
This commit is contained in:
commit
2dc69eef1b
|
@ -134,10 +134,8 @@ static void create_pack_revindex(struct packed_git *p)
|
||||||
if (!(off & 0x80000000)) {
|
if (!(off & 0x80000000)) {
|
||||||
p->revindex[i].offset = off;
|
p->revindex[i].offset = off;
|
||||||
} else {
|
} else {
|
||||||
p->revindex[i].offset =
|
p->revindex[i].offset = get_be64(off_64);
|
||||||
((uint64_t)ntohl(*off_64++)) << 32;
|
off_64 += 2;
|
||||||
p->revindex[i].offset |=
|
|
||||||
ntohl(*off_64++);
|
|
||||||
}
|
}
|
||||||
p->revindex[i].nr = i;
|
p->revindex[i].nr = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1713,8 +1713,7 @@ off_t nth_packed_object_offset(const struct packed_git *p, uint32_t n)
|
||||||
return off;
|
return off;
|
||||||
index += p->num_objects * 4 + (off & 0x7fffffff) * 8;
|
index += p->num_objects * 4 + (off & 0x7fffffff) * 8;
|
||||||
check_pack_index_ptr(p, index);
|
check_pack_index_ptr(p, index);
|
||||||
return (((uint64_t)ntohl(*((uint32_t *)(index + 0)))) << 32) |
|
return get_be64(index);
|
||||||
ntohl(*((uint32_t *)(index + 4)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue