This commit is contained in:
debris 2015-11-26 00:09:09 +01:00
parent e40bb6d52c
commit 4748ed5221

View File

@ -243,6 +243,7 @@ impl RlpStream {
} }
/// declare appending the list of given size /// declare appending the list of given size
/// TODO: optimise insertion of empty list
pub fn append_list<'a>(&'a mut self, len: usize) -> &'a mut RlpStream { pub fn append_list<'a>(&'a mut self, len: usize) -> &'a mut RlpStream {
// push new list // push new list
let position = self.encoder.bytes.len(); let position = self.encoder.bytes.len();
@ -356,6 +357,7 @@ impl BasicEncoder {
} }
/// inserts list prefix at given position /// inserts list prefix at given position
/// TODO: optimise it, so it does not copy an array
fn insert_list_len_at_pos(&mut self, len: usize, pos: usize) -> () { fn insert_list_len_at_pos(&mut self, len: usize, pos: usize) -> () {
// new bytes // new bytes
let mut res: Vec<u8> = vec![]; let mut res: Vec<u8> = vec![];