Use iterator chaining over hash insertion

This commit is contained in:
Richard Feldman 2020-05-01 19:40:59 -04:00
parent 5f33073703
commit 095844c2c1

View file

@ -367,11 +367,9 @@ fn gen(
jump_counter: arena.alloc(0),
};
// TODO remove this
decls_by_id.insert(loaded.module_id, home_decls);
// Populate Procs from decls
for (_, mut decls) in decls_by_id.drain() {
// Add modules' decls to Procs
for (_, mut decls) in decls_by_id.drain().chain(std::iter::once((loaded.module_id, home_decls))) {
for decl in decls.drain(..) {
use roc_can::def::Declaration::*;
use roc_can::expr::Expr::*;