Skip to content

Commit

Permalink
Remove copy of HashedWriter
Browse files Browse the repository at this point in the history
It was added to the standard library in ziglang#18733.
  • Loading branch information
ianprime0509 committed Nov 23, 2024
1 parent 0c5880a commit 8e36919
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Package/Fetch/git.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ pub fn indexPack(allocator: Allocator, pack: std.fs.File, index_writer: anytype)
}
@memset(fan_out_table[fan_out_index..], count);

var index_hashed_writer = hashedWriter(index_writer, Sha1.init(.{}));
var index_hashed_writer = std.compress.hashedWriter(index_writer, Sha1.init(.{}));
const writer = index_hashed_writer.writer();
try writer.writeAll(IndexHeader.signature);
try writer.writeInt(u32, IndexHeader.supported_version, .big);
Expand Down Expand Up @@ -1196,7 +1196,7 @@ fn indexPackFirstPass(
.commit, .tree, .blob, .tag => |object| {
var entry_decompress_stream = std.compress.zlib.decompressor(entry_crc32_reader.reader());
var entry_counting_reader = std.io.countingReader(entry_decompress_stream.reader());
var entry_hashed_writer = hashedWriter(std.io.null_writer, Sha1.init(.{}));
var entry_hashed_writer = std.compress.hashedWriter(std.io.null_writer, Sha1.init(.{}));
const entry_writer = entry_hashed_writer.writer();
// The object header is not included in the pack data but is
// part of the object's ID
Expand Down Expand Up @@ -1282,7 +1282,7 @@ fn indexPackHashDelta(
const base_data = try resolveDeltaChain(allocator, pack, base_object, delta_offsets.items, cache);

var entry_hasher = Sha1.init(.{});
var entry_hashed_writer = hashedWriter(std.io.null_writer, &entry_hasher);
var entry_hashed_writer = std.compress.hashedWriter(std.io.null_writer, &entry_hasher);
try entry_hashed_writer.writer().print("{s} {}\x00", .{ @tagName(base_object.type), base_data.len });
entry_hasher.update(base_data);
return entry_hasher.finalResult();
Expand Down

0 comments on commit 8e36919

Please sign in to comment.