mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Add optimized SSZ decoding for fixed-len items (#865)
* Add custom SSZ decode for Validator * Move efficient decode into macro * Don't allocate SSZ offset to heap * Use smallvec in SszDecoder * Fix test compile error
This commit is contained in:
@@ -221,9 +221,9 @@ impl<T: Encode> Encode for Option<T> {
|
||||
|
||||
fn ssz_append(&self, buf: &mut Vec<u8>) {
|
||||
match self {
|
||||
None => buf.append(&mut encode_union_index(0)),
|
||||
None => buf.extend_from_slice(&encode_union_index(0)),
|
||||
Some(t) => {
|
||||
buf.append(&mut encode_union_index(1));
|
||||
buf.extend_from_slice(&encode_union_index(1));
|
||||
t.ssz_append(buf);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user