authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-15 19:45:23-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
log4d62d97076a10cc6371fb6cbbfec8c906611a72b
tree89a3268a45ce38177016d980a2f444dd674835ff
parentb429f4607c320118f5e0443605b29dda39521204

Update code using deprecated ArrayList APIs


1 files changed, 4 insertions(+), 4 deletions(-)

lib/std/cache_hash.zig+4-4
...@@ -148,7 +148,7 @@ pub const CacheHash = struct {...@@ -148,7 +148,7 @@ pub const CacheHash = struct {
148148
149 var cache_hash_file: *File = undefined;149 var cache_hash_file: *File = undefined;
150 if (idx < input_file_count) {150 if (idx < input_file_count) {
151 cache_hash_file = self.files.ptrAt(idx);151 cache_hash_file = &self.files.items[idx];
152 } else {152 } else {
153 cache_hash_file = try self.files.addOne();153 cache_hash_file = try self.files.addOne();
154 cache_hash_file.path = null;154 cache_hash_file.path = null;
...@@ -213,7 +213,7 @@ pub const CacheHash = struct {...@@ -213,7 +213,7 @@ pub const CacheHash = struct {
213 self.blake3 = Blake3.init();213 self.blake3 = Blake3.init();
214 self.blake3.update(&bin_digest);214 self.blake3.update(&bin_digest);
215 try self.files.resize(input_file_count);215 try self.files.resize(input_file_count);
216 for (self.files.toSlice()) |file| {216 for (self.files.items) |file| {
217 self.blake3.update(&file.bin_digest);217 self.blake3.update(&file.bin_digest);
218 }218 }
219 return null;219 return null;
...@@ -308,7 +308,7 @@ pub const CacheHash = struct {...@@ -308,7 +308,7 @@ pub const CacheHash = struct {
308 var outStream = contents.outStream();308 var outStream = contents.outStream();
309 defer contents.deinit();309 defer contents.deinit();
310310
311 for (self.files.toSlice()) |file| {311 for (self.files.items) |file| {
312 base64_encoder.encode(encoded_digest[0..], &file.bin_digest);312 base64_encoder.encode(encoded_digest[0..], &file.bin_digest);
313 try outStream.print("{} {} {} {}\n", .{ file.stat.inode, file.stat.mtime, encoded_digest[0..], file.path });313 try outStream.print("{} {} {} {}\n", .{ file.stat.inode, file.stat.mtime, encoded_digest[0..], file.path });
314 }314 }
...@@ -332,7 +332,7 @@ pub const CacheHash = struct {...@@ -332,7 +332,7 @@ pub const CacheHash = struct {
332332
333 self.manifest_file.?.close();333 self.manifest_file.?.close();
334334
335 for (self.files.toSlice()) |*file| {335 for (self.files.items) |*file| {
336 file.deinit(self.alloc);336 file.deinit(self.alloc);
337 }337 }
338 self.files.deinit();338 self.files.deinit();