Remove explicit empty stack nodes (#1445)

* Remove explicit empty stack nodes

* Code review stylistic simplifications

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2023-10-28 20:41:31 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent ceb2f4c13f
commit 380bc19b09
4 changed files with 45 additions and 24 deletions
@@ -10,6 +10,7 @@ pub struct Compiler {}
impl Compiler {
pub fn compile(&self, mut network: NodeNetwork) -> Result<impl Iterator<Item = ProtoNetwork>, String> {
println!("flattening");
network.resolve_empty_stacks();
let node_ids = network.nodes.keys().copied().collect::<Vec<_>>();
for id in node_ids {
network.flatten(id);