mirror of
https://github.com/ziglang/zig.git
synced 2026-02-18 07:18:38 +00:00
Remove non-null assertion in CacheHash.release()
People using the API as intended would never trigger this assertion anyway, but if someone has a non standard use case, I see no reason to make the program panic.
This commit is contained in:
parent
e6a37ed941
commit
be69e8e871
@ -349,14 +349,14 @@ pub const CacheHash = struct {
|
||||
/// Writing to the manifest file is the only way that this file can return an
|
||||
/// error.
|
||||
pub fn release(self: *@This()) !void {
|
||||
debug.assert(self.manifest_file != null);
|
||||
if (self.manifest_file) |file| {
|
||||
if (self.manifest_dirty) {
|
||||
try self.write_manifest();
|
||||
}
|
||||
|
||||
if (self.manifest_dirty) {
|
||||
try self.write_manifest();
|
||||
file.close();
|
||||
}
|
||||
|
||||
self.manifest_file.?.close();
|
||||
|
||||
for (self.files.items) |*file| {
|
||||
file.deinit(self.alloc);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user