Skip to content

Commit

Permalink
chore: remove unnecessary if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Apr 29, 2023
1 parent e90e915 commit 5cf7580
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/noirc_frontend/src/hir/def_collector/dc_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,10 @@ fn resolve_globals(
let name = global.stmt_def.pattern.name_ident().clone();

let hir_stmt = resolver.resolve_global_let(global.stmt_def);
let errs = resolver.take_errors();
if !errs.is_empty() {
extend_errors(errors, global.file_id, errs);
} else {
context.def_interner.update_global(global.stmt_id, hir_stmt);
context.def_interner.push_global(global.stmt_id, name, global.module_id, storage_slot);
}
extend_errors(errors, global.file_id, resolver.take_errors());

context.def_interner.update_global(global.stmt_id, hir_stmt);
context.def_interner.push_global(global.stmt_id, name, global.module_id, storage_slot);

(global.file_id, global.stmt_id)
})
Expand Down

0 comments on commit 5cf7580

Please sign in to comment.