File tree Expand file tree Collapse file tree
crates/move-stackless-bytecode/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -611,13 +611,18 @@ impl Analyzer<'_> {
611611 }
612612
613613 fn analyze_type_invariant_functions ( & mut self ) {
614- let struct_instantiations: Vec < _ > = self . info . structs . clone ( ) . into_iter ( ) . collect ( ) ;
615-
616- for ( struct_qid, type_instantiations) in struct_instantiations {
617- if let Some ( inv_fun_qid) = self . targets . get_inv_by_datatype ( & struct_qid) {
618- for type_inst in type_instantiations {
619- self . push_todo_fun ( * inv_fun_qid, type_inst. clone ( ) ) ;
620- }
614+ let items_to_process: Vec < _ > = self . info . structs
615+ . iter ( )
616+ . filter_map ( |( struct_qid, type_instantiations) | {
617+ self . targets . get_inv_by_datatype ( struct_qid) . map ( |inv_fun_qid| {
618+ ( * inv_fun_qid, type_instantiations. clone ( ) )
619+ } )
620+ } )
621+ . collect ( ) ;
622+
623+ for ( inv_fun_qid, type_instantiations) in items_to_process {
624+ for type_inst in type_instantiations. iter ( ) {
625+ self . push_todo_fun ( inv_fun_qid, type_inst. clone ( ) ) ;
621626 }
622627 }
623628 }
You can’t perform that action at this time.
0 commit comments