Skip to content

Commit 97954ee

Browse files
author
Colin Stolley
committed
Replace bitwise AND 0x7fffffff with XOR 0x80000000.
Though both are correct, this makes it clear that we're dealing with the same value.
1 parent 8a765c7 commit 97954ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libgit2/midx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ int git_midx_entry_find(
432432
object_offset = idx->object_offsets + pos * 8;
433433
offset = ntohl(*((uint32_t *)(object_offset + 4)));
434434
if (idx->object_large_offsets && offset & 0x80000000) {
435-
uint32_t object_large_offsets_pos = offset & 0x7fffffff;
435+
uint32_t object_large_offsets_pos = (uint32_t) (offset ^ 0x80000000);
436436
const unsigned char *object_large_offsets_index = idx->object_large_offsets;
437437

438438
/* Make sure we're not being sent out of bounds */

0 commit comments

Comments
 (0)