Improve allocations for SszEncoder

This commit is contained in:
Paul Hauner
2019-05-06 09:58:31 +10:00
parent 480c5ff160
commit 56fe63f78d
4 changed files with 22 additions and 19 deletions

View File

@@ -17,13 +17,13 @@ impl Encodable for Foo {
+ <Vec<u16> as Encodable>::ssz_fixed_len()
+ <u16 as Encodable>::ssz_fixed_len();
let mut encoder = SszEncoder::container(offset);
let mut encoder = SszEncoder::container(buf, offset);
encoder.append(&self.a);
encoder.append(&self.b);
encoder.append(&self.c);
encoder.drain_onto(buf);
encoder.finalize();
}
}