Skip to content

Commit

Permalink
Fix array_snapshot_pop_front CoW clones. (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
azteca1998 authored Jan 3, 2025
1 parent 608258a commit 8d700c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libfuncs/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ fn build_pop<'ctx, 'this, const CONSUME: bool, const REVERSE: bool>(
block.const_int(context, location, elem_layout.pad_to_align().size(), 64)?;
match metadata.get::<DupOverridesMeta>() {
Some(dup_overrides_meta) if dup_overrides_meta.is_overriden(elem_ty) => {
// TODO: If extract_len is 1 there is no need for the for loop.
block.append_operation(scf::r#for(
k0,
value_size,
Expand Down Expand Up @@ -1159,7 +1160,7 @@ fn build_pop<'ctx, 'this, const CONSUME: bool, const REVERSE: bool>(
)?;

let data_ptr = if REVERSE {
data_ptr
array_ptr
} else {
let offset = block.append_op_result(arith::extui(
extract_len_value,
Expand Down

0 comments on commit 8d700c9

Please sign in to comment.