mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-10-23 12:16:25 +00:00
Less slices (#9176)
* Less slices Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
1 parent
7b50bbb9bf
commit
07449840bd
11 files changed
+41
-46
No files matched your search
@@ -44,7 +44,7 @@ fn encode_with_vec_prefix<T: Encode, F: Fn(&mut Vec<u8>)>(encoder: F) -> Vec<u8>
|
||||
let size = ::sp_std::mem::size_of::<T>();
|
||||
let reserve = match size {
|
||||
0..=0b00111111 => 1,
|
||||
0..=0b00111111_11111111 => 2,
|
||||
0b01000000..=0b00111111_11111111 => 2,
|
||||
_ => 4,
|
||||
};
|
||||
let mut v = Vec::with_capacity(reserve + size);
|
||||
|
||||
Reference in new issue
Block a user