Make if statement more idiomatic
parent
2c59f95e87
commit
42007307be
|
@ -182,9 +182,11 @@ pub const CacheHash = struct {
|
|||
if (file_path.len == 0) {
|
||||
return error.InvalidFormat;
|
||||
}
|
||||
if (cache_hash_file.path != null and !mem.eql(u8, file_path, cache_hash_file.path.?)) {
|
||||
if (cache_hash_file.path) |p| {
|
||||
if (!mem.eql(u8, file_path, p)) {
|
||||
return error.InvalidFormat;
|
||||
}
|
||||
}
|
||||
|
||||
if (cache_hash_file.path == null) {
|
||||
cache_hash_file.path = try mem.dupe(self.alloc, u8, file_path);
|
||||
|
|
Loading…
Reference in New Issue