authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-30 17:12:29-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
log42007307bed84ba691b86e17b6e414eef352e94c
tree72f253abd545c4ccdee354607fec8c96865b43a0
parent2c59f95e87979163e746cee2783d58d2f54e7da6

Make if statement more idiomatic


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

lib/std/cache_hash.zig+4-2
......@@ -182,8 +182,10 @@ pub const CacheHash = struct {
182182 if (file_path.len == 0) {
183183 return error.InvalidFormat;
184184 }
185 if (cache_hash_file.path != null and !mem.eql(u8, file_path, cache_hash_file.path.?)) {
186 return error.InvalidFormat;
185 if (cache_hash_file.path) |p| {
186 if (!mem.eql(u8, file_path, p)) {
187 return error.InvalidFormat;
188 }
187189 }
188190
189191 if (cache_hash_file.path == null) {