diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-06-20 13:44:24 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2023-06-20 14:02:09 -0400 |
| commit | d7bd4f339c90b9ce07283600cb7ef129912ceef3 (patch) | |
| tree | ff3d181923df575edd51562397f60c93eff8d8e7 /src/value.zig | |
| parent | 6b56f4ff0bf9ac9c5e0b4a11cf0536472447bc4a (diff) | |
| download | zig-d7bd4f339c90b9ce07283600cb7ef129912ceef3.tar.gz zig-d7bd4f339c90b9ce07283600cb7ef129912ceef3.zip | |
Sema: optimize value resolution
Diffstat (limited to 'src/value.zig')
| -rw-r--r-- | src/value.zig | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/value.zig b/src/value.zig index 0a5131d3f8..573f0ca7e2 100644 --- a/src/value.zig +++ b/src/value.zig @@ -1991,12 +1991,7 @@ pub const Value = struct { } pub fn isUndef(val: Value, mod: *Module) bool { - if (val.ip_index == .none) return false; - return switch (mod.intern_pool.indexToKey(val.toIntern())) { - .undef => true, - .simple_value => |v| v == .undefined, - else => false, - }; + return val.ip_index != .none and mod.intern_pool.isUndef(val.toIntern()); } /// TODO: check for cases such as array that is not marked undef but all the element |
