From 42007307bed84ba691b86e17b6e414eef352e94c Mon Sep 17 00:00:00 2001 From: LeRoyce Pearson Date: Thu, 30 Apr 2020 17:12:29 -0600 Subject: [PATCH] Make if statement more idiomatic --- lib/std/cache_hash.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/std/cache_hash.zig b/lib/std/cache_hash.zig index 39a7f65350..6fea1b3e2e 100644 --- a/lib/std/cache_hash.zig +++ b/lib/std/cache_hash.zig @@ -182,8 +182,10 @@ 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.?)) { - return error.InvalidFormat; + if (cache_hash_file.path) |p| { + if (!mem.eql(u8, file_path, p)) { + return error.InvalidFormat; + } } if (cache_hash_file.path == null) {