File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -179,14 +179,14 @@ impl Sort for SetSort {
179179 termdag : & mut TermDag ,
180180 ) -> Option < ( Cost , Term ) > {
181181 let set = ValueSet :: load ( self , & value) ;
182- let mut term = termdag . app ( "set-empty" . into ( ) , vec ! [ ] ) ;
182+ let mut children = vec ! [ ] ;
183183 let mut cost = 0usize ;
184- for e in set. iter ( ) . rev ( ) {
185- let e = extractor. find_best ( * e, termdag, & self . element ) ?;
186- cost = cost. saturating_add ( e . 0 ) ;
187- term = termdag . app ( "set-insert" . into ( ) , vec ! [ term , e . 1 ] )
184+ for e in set. iter ( ) {
185+ let ( child_cost , child_term ) = extractor. find_best ( * e, termdag, & self . element ) ?;
186+ cost = cost. saturating_add ( child_cost ) ;
187+ children . push ( child_term ) ;
188188 }
189- Some ( ( cost, term ) )
189+ Some ( ( cost, termdag . app ( "set-of" . into ( ) , children ) ) )
190190 }
191191
192192 fn serialized_name ( & self , _value : & Value ) -> Symbol {
You can’t perform that action at this time.
0 commit comments