cgen: minor cleanup of comp_for in comptime.v (#8337)
							parent
							
								
									006a11454f
								
							
						
					
					
						commit
						3199b982a9
					
				|  | @ -298,8 +298,7 @@ fn (mut g Gen) comp_for(node ast.CompFor) { | ||||||
| 		methods_with_attrs := sym.methods.filter(it.attrs.len > 0) // methods with attrs second
 | 		methods_with_attrs := sym.methods.filter(it.attrs.len > 0) // methods with attrs second
 | ||||||
| 		methods << methods_with_attrs | 		methods << methods_with_attrs | ||||||
| 		if methods.len > 0 { | 		if methods.len > 0 { | ||||||
| 			g.writeln('\tFunctionData $node.val_var;') | 			g.writeln('\tFunctionData $node.val_var = {0};') | ||||||
| 			g.writeln('\tmemset(&$node.val_var, 0, sizeof(FunctionData));') |  | ||||||
| 		} | 		} | ||||||
| 		for method in methods { // sym.methods {
 | 		for method in methods { // sym.methods {
 | ||||||
| 			/* | 			/* | ||||||
|  | @ -372,8 +371,7 @@ fn (mut g Gen) comp_for(node ast.CompFor) { | ||||||
| 			fields_with_attrs := sym.info.fields.filter(it.attrs.len > 0) | 			fields_with_attrs := sym.info.fields.filter(it.attrs.len > 0) | ||||||
| 			fields << fields_with_attrs | 			fields << fields_with_attrs | ||||||
| 			if fields.len > 0 { | 			if fields.len > 0 { | ||||||
| 				g.writeln('\tFieldData $node.val_var;') | 				g.writeln('\tFieldData $node.val_var = {0};') | ||||||
| 				g.writeln('\tmemset(&$node.val_var, 0, sizeof(FieldData));') |  | ||||||
| 			} | 			} | ||||||
| 			for field in fields { | 			for field in fields { | ||||||
| 				g.comp_for_field_var = node.val_var | 				g.comp_for_field_var = node.val_var | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue