fix off-by-one error in List.dropAt

This commit is contained in:
Folkert 2022-09-28 14:57:55 +02:00
parent d70625b21b
commit f44a30cf48
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -595,9 +595,10 @@ pub fn listDropAt(
if (list.isUnique()) {
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_source = copy_target + element_width;
@memcpy(copy_target, copy_source, element_width);
}