mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
store list in a shorter way
This commit is contained in:
parent
b7d78d9237
commit
2fe590abf4
4 changed files with 41 additions and 50 deletions
|
@ -2412,7 +2412,7 @@ fn list_literal<'a, 'ctx, 'env>(
|
|||
.build_in_bounds_gep(global, &[zero, offset], "first_element_pointer")
|
||||
};
|
||||
|
||||
super::build_list::store_list(env, ptr, list_length_intval)
|
||||
super::build_list::store_list(env, ptr, list_length_intval).into()
|
||||
} else {
|
||||
// some of our elements are non-constant, so we must allocate space on the heap
|
||||
let ptr = allocate_list(env, element_layout, list_length_intval);
|
||||
|
@ -2436,7 +2436,7 @@ fn list_literal<'a, 'ctx, 'env>(
|
|||
builder.build_store(elem_ptr, val);
|
||||
}
|
||||
|
||||
super::build_list::store_list(env, ptr, list_length_intval)
|
||||
super::build_list::store_list(env, ptr, list_length_intval).into()
|
||||
}
|
||||
} else {
|
||||
let ptr = allocate_list(env, element_layout, list_length_intval);
|
||||
|
@ -2455,7 +2455,7 @@ fn list_literal<'a, 'ctx, 'env>(
|
|||
store_roc_value(env, *element_layout, elem_ptr, val);
|
||||
}
|
||||
|
||||
super::build_list::store_list(env, ptr, list_length_intval)
|
||||
super::build_list::store_list(env, ptr, list_length_intval).into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue