zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 495fd4ee3e81bd9d26768cdb8fc639afac79d9dc (tree)
parent 287ff4ab58f8af70383b6e334c7c862c8b8fbeec
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sun,  6 Feb 2022 19:45:49 -0700

AstGen: refactor redundant expressions

This is a non-functional change.

Diffstat:
Msrc/AstGen.zig | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/AstGen.zig b/src/AstGen.zig @@ -2601,8 +2601,8 @@ fn varDecl( var resolve_inferred_alloc: Zir.Inst.Ref = .none; var opt_type_inst: Zir.Inst.Ref = .none; - if (var_decl.ast.type_node != 0) { - const type_inst = try typeExpr(gz, &init_scope.base, var_decl.ast.type_node); + if (type_node != 0) { + const type_inst = try typeExpr(gz, &init_scope.base, type_node); opt_type_inst = type_inst; if (align_inst == .none) { init_scope.instructions_top = gz.instructions.items.len; @@ -2683,7 +2683,7 @@ fn varDecl( const src_inst = gz.instructions.items[src]; if (zir_tags[src_inst] == .store_to_block_ptr) { if (zir_datas[src_inst].bin.lhs == init_scope.rl_ptr) { - if (var_decl.ast.type_node != 0) { + if (type_node != 0) { zir_tags[src_inst] = .store; } else { zir_tags[src_inst] = .store_to_inferred_ptr;