diff options
Diffstat (limited to 'pack-bitmap-write.c')
-rw-r--r-- | pack-bitmap-write.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c index 5f1791a59c..c05d1386af 100644 --- a/pack-bitmap-write.c +++ b/pack-bitmap-write.c @@ -111,8 +111,7 @@ static inline void push_bitmapped_commit(struct commit *commit, struct ewah_bitm { if (writer.selected_nr >= writer.selected_alloc) { writer.selected_alloc = (writer.selected_alloc + 32) * 2; - writer.selected = xrealloc(writer.selected, - writer.selected_alloc * sizeof(struct bitmapped_commit)); + REALLOC_ARRAY(writer.selected, writer.selected_alloc); } writer.selected[writer.selected_nr].commit = commit; @@ -473,7 +472,6 @@ static void write_selected_commits_v1(struct sha1file *f, for (i = 0; i < writer.selected_nr; ++i) { struct bitmapped_commit *stored = &writer.selected[i]; - struct bitmap_disk_entry on_disk; int commit_pos = sha1_pos(stored->commit->object.sha1, index, index_nr, sha1_access); @@ -481,11 +479,10 @@ static void write_selected_commits_v1(struct sha1file *f, if (commit_pos < 0) die("BUG: trying to write commit not in index"); - on_disk.object_pos = htonl(commit_pos); - on_disk.xor_offset = stored->xor_offset; - on_disk.flags = stored->flags; + sha1write_be32(f, commit_pos); + sha1write_u8(f, stored->xor_offset); + sha1write_u8(f, stored->flags); - sha1write(f, &on_disk, sizeof(on_disk)); dump_bitmap(f, stored->write_as); } } |