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

all: change f mut Foo to mut f Foo

This commit is contained in:
yuyi
2020-06-04 16:35:40 +08:00
committed by GitHub
parent 0b7fe0a9d0
commit 5ae8853648
36 changed files with 62 additions and 65 deletions

View File

@@ -8,7 +8,7 @@ module cipher
// xor_bytes xors the bytes in a and b. The destination should have enough
// space, otherwise xor_bytes will panic. Returns the number of bytes xor'd.
pub fn xor_bytes(dst mut []byte, a, b []byte) int {
pub fn xor_bytes(mut dst []byte, a, b []byte) int {
mut n := a.len
if b.len < n {
n = b.len
@@ -23,7 +23,7 @@ pub fn xor_bytes(dst mut []byte, a, b []byte) int {
}
// n needs to be smaller or equal than the length of a and b.
pub fn safe_xor_bytes(dst mut []byte, a, b []byte, n int) {
pub fn safe_xor_bytes(mut dst []byte, a, b []byte, n int) {
for i in 0..n {
dst[i] = a[i] ^ b[i]
}
@@ -31,6 +31,6 @@ pub fn safe_xor_bytes(dst mut []byte, a, b []byte, n int) {
// fast_xor_words XORs multiples of 4 or 8 bytes (depending on architecture.)
// The slice arguments a and b are assumed to be of equal length.
pub fn xor_words(dst mut []byte, a, b []byte) {
pub fn xor_words(mut dst []byte, a, b []byte) {
safe_xor_bytes(mut dst, a, b, b.len)
}