mirror of
https://github.com/vlang/v.git
synced 2025-09-09 15:27:05 -04:00
This commit is contained in:
parent
fca8092523
commit
448f60422a
@ -1231,7 +1231,7 @@ The behaviour depends on the parent's capacity and is predictable:
|
|||||||
|
|
||||||
```v
|
```v
|
||||||
mut a := []int{len: 5, cap: 6, init: 2}
|
mut a := []int{len: 5, cap: 6, init: 2}
|
||||||
mut b := a[1..4]
|
mut b := unsafe { a[1..4] }
|
||||||
a << 3
|
a << 3
|
||||||
// no reallocation - fits in `cap`
|
// no reallocation - fits in `cap`
|
||||||
b[2] = 13 // `a[3]` is modified
|
b[2] = 13 // `a[3]` is modified
|
||||||
|
Loading…
x
Reference in New Issue
Block a user