mirror of
https://github.com/waku-org/go-multiaddr.git
synced 2025-02-23 03:28:12 +00:00
chore: use pre-encoded codec
This commit is contained in:
parent
f96df18bf0
commit
bdd6dd165d
2
codec.go
2
codec.go
@ -30,7 +30,7 @@ func stringToBytes(s string) ([]byte, error) {
|
|||||||
if p.Code == 0 {
|
if p.Code == 0 {
|
||||||
return nil, fmt.Errorf("failed to parse multiaddr %q: unknown protocol %s", s, sp[0])
|
return nil, fmt.Errorf("failed to parse multiaddr %q: unknown protocol %s", s, sp[0])
|
||||||
}
|
}
|
||||||
_, _ = b.Write(CodeToVarint(p.Code))
|
_, _ = b.Write(p.VCode)
|
||||||
sp = sp[1:]
|
sp = sp[1:]
|
||||||
|
|
||||||
if p.Size == 0 { // no length.
|
if p.Size == 0 { // no length.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user