diff --git a/vlib/builtin/array.v b/vlib/builtin/array.v index 6109d66178..e29e50d478 100644 --- a/vlib/builtin/array.v +++ b/vlib/builtin/array.v @@ -402,12 +402,13 @@ pub fn (mut a array) pop() voidptr { a.len = new_len // Note: a.cap is not changed here *on purpose*, so that // further << ops on that array will be more efficient. - return unsafe { memdup(last_elem, a.element_size) } + return last_elem } // delete_last efficiently deletes the last element of the array. // It does it simply by reducing the length of the array by 1. // If the array is empty, this will panic. +// See also: [trim](#array.trim) pub fn (mut a array) delete_last() { // copy pasting code for performance $if !no_bounds_checking ? {