mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: pre alloc on send raw (#14611)
This commit is contained in:
@ -257,7 +257,7 @@ where
|
|||||||
|
|
||||||
/// Sends a raw capability message directly over the stream
|
/// Sends a raw capability message directly over the stream
|
||||||
pub fn start_send_raw(&mut self, msg: RawCapabilityMessage) -> Result<(), EthStreamError> {
|
pub fn start_send_raw(&mut self, msg: RawCapabilityMessage) -> Result<(), EthStreamError> {
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::with_capacity(msg.payload.len() + 1);
|
||||||
msg.id.encode(&mut bytes);
|
msg.id.encode(&mut bytes);
|
||||||
bytes.extend_from_slice(&msg.payload);
|
bytes.extend_from_slice(&msg.payload);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user