mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-12 01:23:49 +00:00
fix off-by-one error in List.dropAt
This commit is contained in:
parent
d70625b21b
commit
f44a30cf48
1 changed files with 2 additions and 1 deletions
|
|
@ -595,9 +595,10 @@ pub fn listDropAt(
|
||||||
|
|
||||||
if (list.isUnique()) {
|
if (list.isUnique()) {
|
||||||
var i = drop_index;
|
var i = drop_index;
|
||||||
while (i < size) : (i += 1) {
|
while (i < size - 1) : (i += 1) {
|
||||||
const copy_target = source_ptr + i * element_width;
|
const copy_target = source_ptr + i * element_width;
|
||||||
const copy_source = copy_target + element_width;
|
const copy_source = copy_target + element_width;
|
||||||
|
|
||||||
@memcpy(copy_target, copy_source, element_width);
|
@memcpy(copy_target, copy_source, element_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue