Skip to content

Commit 7fa34c2

Browse files
committed
Merge branch 'rs/pack-write-hashwrite-simplify'
Code clean-up. * rs/pack-write-hashwrite-simplify: pack-write: use hashwrite_be32() instead of double-buffering array
2 parents fb628ab + 06d43fa commit 7fa34c2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pack-write.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
4848
struct hashfile *f;
4949
struct pack_idx_entry **sorted_by_sha, **list, **last;
5050
off_t last_obj_offset = 0;
51-
uint32_t array[256];
5251
int i, fd;
5352
uint32_t index_version;
5453

@@ -106,10 +105,9 @@ const char *write_idx_file(const char *index_name, struct pack_idx_entry **objec
106105
break;
107106
next++;
108107
}
109-
array[i] = htonl(next - sorted_by_sha);
108+
hashwrite_be32(f, next - sorted_by_sha);
110109
list = next;
111110
}
112-
hashwrite(f, array, 256 * 4);
113111

114112
/*
115113
* Write the actual SHA1 entries..

0 commit comments

Comments
 (0)