Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mf
go-multiaddr
Commits
e2f4e4e8
Commit
e2f4e4e8
authored
Mar 30, 2021
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unused bytesSplit function
parent
d7d65e55
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
26 deletions
+0
-26
codec.go
codec.go
+0
-26
No files found.
codec.go
View file @
e2f4e4e8
...
@@ -176,29 +176,3 @@ func sizeForAddr(p Protocol, b []byte) (skip, size int, err error) {
...
@@ -176,29 +176,3 @@ func sizeForAddr(p Protocol, b []byte) (skip, size int, err error) {
return
n
,
size
,
nil
return
n
,
size
,
nil
}
}
}
}
func
bytesSplit
(
b
[]
byte
)
([][]
byte
,
error
)
{
var
ret
[][]
byte
for
len
(
b
)
>
0
{
code
,
n
,
err
:=
ReadVarintCode
(
b
)
if
err
!=
nil
{
return
nil
,
err
}
p
:=
ProtocolWithCode
(
code
)
if
p
.
Code
==
0
{
return
nil
,
fmt
.
Errorf
(
"no protocol with code %d"
,
b
[
0
])
}
n2
,
size
,
err
:=
sizeForAddr
(
p
,
b
[
n
:
])
if
err
!=
nil
{
return
nil
,
err
}
length
:=
n
+
n2
+
size
ret
=
append
(
ret
,
b
[
:
length
])
b
=
b
[
length
:
]
}
return
ret
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment