mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +00:00
Use allocate_list in List.concat for combined_list_ptr
This commit is contained in:
parent
29c0bfa65d
commit
6e4c24735b
1 changed files with 1 additions and 10 deletions
|
@ -933,8 +933,6 @@ pub fn list_concat<'a, 'ctx, 'env>(
|
||||||
let elem_type = basic_type_from_layout(env.arena, ctx, elem_layout, env.ptr_bytes);
|
let elem_type = basic_type_from_layout(env.arena, ctx, elem_layout, env.ptr_bytes);
|
||||||
let ptr_type = get_ptr_type(&elem_type, AddressSpace::Generic);
|
let ptr_type = get_ptr_type(&elem_type, AddressSpace::Generic);
|
||||||
|
|
||||||
let elem_type = basic_type_from_layout(env.arena, ctx, elem_layout, env.ptr_bytes);
|
|
||||||
|
|
||||||
let if_second_list_is_empty = || {
|
let if_second_list_is_empty = || {
|
||||||
let (new_wrapper, _) = clone_nonempty_list(
|
let (new_wrapper, _) = clone_nonempty_list(
|
||||||
env,
|
env,
|
||||||
|
@ -956,14 +954,7 @@ pub fn list_concat<'a, 'ctx, 'env>(
|
||||||
let combined_list_len =
|
let combined_list_len =
|
||||||
builder.build_int_add(first_list_len, second_list_len, "add_list_lengths");
|
builder.build_int_add(first_list_len, second_list_len, "add_list_lengths");
|
||||||
|
|
||||||
let combined_list_ptr = env
|
let combined_list_ptr = allocate_list(env, elem_layout, combined_list_len);
|
||||||
.builder
|
|
||||||
.build_array_malloc(
|
|
||||||
elem_type,
|
|
||||||
combined_list_len,
|
|
||||||
"create_combined_list_ptr",
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// FIRST LOOP
|
// FIRST LOOP
|
||||||
let first_loop = |first_index| {
|
let first_loop = |first_index| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue