mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
lnwire: refactor Encode to use specific writers - III
This commit refactors the remaining usage of WriteElements. By replacing the interface types with concrete types for the params used in the methods, most of the encoding of the messages now takes zero heap allocations.
This commit is contained in:
@@ -18,7 +18,7 @@ type ExtraOpaqueData []byte
|
||||
// Encode attempts to encode the raw extra bytes into the passed io.Writer.
|
||||
func (e *ExtraOpaqueData) Encode(w *bytes.Buffer) error {
|
||||
eBytes := []byte((*e)[:])
|
||||
if err := WriteElements(w, eBytes); err != nil {
|
||||
if err := WriteBytes(w, eBytes); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user