mirror of
https://github.com/logos-messaging/go-multiaddr.git
synced 2026-01-03 21:43:06 +00:00
don't put the buffer struct on the heap
This showed up when profile go-ipfs.
This commit is contained in:
parent
2e9c819c18
commit
7989a080af
2
codec.go
2
codec.go
@ -11,7 +11,7 @@ func stringToBytes(s string) ([]byte, error) {
|
|||||||
// consume trailing slashes
|
// consume trailing slashes
|
||||||
s = strings.TrimRight(s, "/")
|
s = strings.TrimRight(s, "/")
|
||||||
|
|
||||||
b := new(bytes.Buffer)
|
var b bytes.Buffer
|
||||||
sp := strings.Split(s, "/")
|
sp := strings.Split(s, "/")
|
||||||
|
|
||||||
if sp[0] != "" {
|
if sp[0] != "" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user