File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -275,14 +275,13 @@ impl<'a> VM<'a> {
275275 pub fn call_list ( & mut self ) -> Result < ( ) , VmErr > {
276276 let o = self . pop ( ) ?;
277277 // Str needs char allocation — handle before extract_iterable_full.
278- if o. is_heap ( ) {
279- if let HeapObj :: Str ( s) = self . heap . get ( o) {
278+ if o. is_heap ( )
279+ && let HeapObj :: Str ( s) = self . heap . get ( o) {
280280 let s = s. clone ( ) ;
281281 let items = self . str_to_char_vals ( & s) ?;
282282 let val = self . heap . alloc ( HeapObj :: List ( Rc :: new ( RefCell :: new ( items) ) ) ) ?;
283283 self . push ( val) ;
284284 return Ok ( ( ) ) ;
285- }
286285 }
287286 let items = self . extract_iterable_full ( o) ?;
288287 let val = self . heap . alloc ( HeapObj :: List ( Rc :: new ( RefCell :: new ( items) ) ) ) ?;
Original file line number Diff line number Diff line change @@ -67,11 +67,10 @@ impl<'a> VM<'a> {
6767 let mut captures: Vec < ( usize , Val ) > = Vec :: new ( ) ;
6868 for ( bi, bname) in body. names . iter ( ) . enumerate ( ) {
6969 if param_names. contains ( bname. as_str ( ) ) { continue ; }
70- if let Some ( & si) = chunk_map. get ( bname. as_str ( ) ) {
71- if let Some ( Some ( v) ) = slots. get ( si) {
70+ if let Some ( & si) = chunk_map. get ( bname. as_str ( ) )
71+ && let Some ( Some ( v) ) = slots. get ( si) {
7272 captures. push ( ( bi, * v) ) ;
7373 }
74- }
7574 }
7675
7776 let val = self . heap . alloc ( HeapObj :: Func ( global, defaults, captures) ) ?;
@@ -261,11 +260,10 @@ impl<'a> VM<'a> {
261260 if let Some ( val) = best {
262261 // Update all versions of this name in the caller's slots.
263262 for ( si, sname) in chunk. names . iter ( ) . enumerate ( ) {
264- if let Some ( p) = sname. rfind ( '_' ) {
265- if & sname[ ..p] == base. as_str ( ) && si < slots. len ( ) {
263+ if let Some ( p) = sname. rfind ( '_' )
264+ && & sname[ ..p] == base. as_str ( ) && si < slots. len ( ) {
266265 slots[ si] = Some ( val) ;
267266 }
268- }
269267 }
270268 }
271269 }
You can’t perform that action at this time.
0 commit comments