| 1 | @[heap] |
| 2 | struct Particle { |
| 3 | } |
| 4 | |
| 5 | @[heap] |
| 6 | struct App { |
| 7 | mut: |
| 8 | list_opti [][]&Particle |
| 9 | } |
| 10 | |
| 11 | fn (mut app App) init_opti_list() { |
| 12 | for mut liste in app.list_opti { |
| 13 | if liste != [] { |
| 14 | liste.clear() |
| 15 | } |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | fn test_main() { |
| 20 | mut app := &App{ |
| 21 | list_opti: [][]&Particle{len: 10, init: []&Particle{}} |
| 22 | } |
| 23 | app.init_opti_list() |
| 24 | } |
| 25 |