mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
vlib: add mut
for the first parameter of builtin.copy, arrays.copy and crypto (#13702)
This commit is contained in:
parent
4c33003f86
commit
7231a3f135
31 changed files with 84 additions and 88 deletions
|
@ -544,7 +544,7 @@ fn swap_nonoverlapping<T>(x_ &T, y_ &T, count int) {
|
|||
// copy copies the `src` array elements to the `dst` array.
|
||||
// The number of the elements copied is the minimum of the length of both arrays.
|
||||
// Returns the number of elements copied.
|
||||
pub fn copy<T>(dst []T, src []T) int {
|
||||
pub fn copy<T>(mut dst []T, src []T) int {
|
||||
min := if dst.len < src.len { dst.len } else { src.len }
|
||||
if min > 0 {
|
||||
blen := min * int(sizeof(T))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue