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

vlib,cgen: cleanup array inits using `.repeat() instead of new init syntax

This commit is contained in:
Emily Hudson
2020-06-27 20:46:04 +01:00
committed by GitHub
parent 2669610be9
commit c84bafbdae
31 changed files with 52 additions and 53 deletions

View File

@@ -30,7 +30,7 @@ fn new_aes_cbc(b AesCipher, iv []byte) AesCbc {
b: b,
block_size: b.block_size(),
iv: iv.clone(),
tmp: [byte(0)].repeat(b.block_size()),
tmp: []byte{len:(b.block_size()),}
}
}

View File

@@ -9,8 +9,8 @@ module aes
fn new_cipher_generic(key []byte) AesCipher {
n := key.len + 28
mut c := AesCipher{
enc: [u32(0)].repeat(n)
dec: [u32(0)].repeat(n)
enc: []u32{len:(n)}
dec: []u32{len:(n)}
}
expand_key_generic(key, mut c.enc, mut c.dec)
return c