1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: fix path_tracing.v compilation, using (*ptr) = expression

This commit is contained in:
Delyan Angelov
2020-04-23 12:19:04 +03:00
parent d5eafe79bd
commit fb97c2e01e
6 changed files with 12 additions and 20 deletions

View File

@ -63,13 +63,11 @@ pub fn (c mut Cipher) xor_key_stream(dst mut []byte, src []byte) {
if src.len == 0 {
return
}
if subtle.inexact_overlap(dst[..src.len], src) {
if subtle.inexact_overlap(dst, src) {
panic('crypto.rc4: invalid buffer overlap')
}
mut i := c.i
mut j := c.j
_ = dst[src.len-1]
*dst = dst[..src.len] // eliminate bounds check from loop
for k, v in src {
i += byte(1)
x := c.s[i]