mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf(db): use Into to encode StoredNibbles (#11350)
This commit is contained in:
@ -125,9 +125,9 @@ impl Encode for StoredNibbles {
|
||||
|
||||
// Delegate to the Compact implementation
|
||||
fn encode(self) -> Self::Encoded {
|
||||
let mut buf = Vec::with_capacity(self.0.len());
|
||||
self.to_compact(&mut buf);
|
||||
buf
|
||||
// NOTE: This used to be `to_compact`, but all it does is append the bytes to the buffer,
|
||||
// so we can just use the implementation of `Into<Vec<u8>>` to reuse the buffer.
|
||||
self.0.into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user