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:
committed by
Andrew Kelley
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user