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:
@@ -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()),}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user