mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Store first element at clone_ptr so as to avoid allocating for a unique index
This commit is contained in:
parent
68b13d29fd
commit
c2351979e0
1 changed files with 1 additions and 9 deletions
|
@ -1568,15 +1568,7 @@ fn list_prepend<'a, 'ctx, 'env>(
|
||||||
let int_type = ptr_int(ctx, ptr_bytes);
|
let int_type = ptr_int(ctx, ptr_bytes);
|
||||||
let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr");
|
let ptr_as_int = builder.build_ptr_to_int(clone_ptr, int_type, "list_cast_ptr");
|
||||||
|
|
||||||
let elem_ptr = unsafe {
|
builder.build_store(clone, elem);
|
||||||
builder.build_in_bounds_gep(
|
|
||||||
clone_ptr,
|
|
||||||
&[ctx.i64_type().const_int(0 as u64, false)],
|
|
||||||
"load_index",
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
builder.build_store(elem_ptr, elem);
|
|
||||||
|
|
||||||
let index_1_ptr = unsafe {
|
let index_1_ptr = unsafe {
|
||||||
builder.build_in_bounds_gep(
|
builder.build_in_bounds_gep(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue