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

compiler/vlib: replace substr/left/right with [start..end] everywhere

This commit is contained in:
joe-conigliaro
2019-10-27 18:03:15 +11:00
committed by Alexander Medvednikov
parent ed55826686
commit 59378dce46
49 changed files with 308 additions and 306 deletions

View File

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