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
ld
go-ld-prime
Commits
2be85512
Commit
2be85512
authored
Feb 27, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tighten up error handling a bit using must.
parent
80febfe2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
tests/traversalBenchmarks.go
tests/traversalBenchmarks.go
+5
-11
No files found.
tests/traversalBenchmarks.go
View file @
2be85512
...
@@ -8,25 +8,19 @@ import (
...
@@ -8,25 +8,19 @@ import (
ipld
"github.com/ipld/go-ipld-prime"
ipld
"github.com/ipld/go-ipld-prime"
"github.com/ipld/go-ipld-prime/encoding"
"github.com/ipld/go-ipld-prime/encoding"
"github.com/ipld/go-ipld-prime/must"
"github.com/ipld/go-ipld-prime/tests/corpus"
"github.com/ipld/go-ipld-prime/tests/corpus"
"github.com/ipld/go-ipld-prime/traversal"
"github.com/ipld/go-ipld-prime/traversal"
"github.com/ipld/go-ipld-prime/traversal/selector"
"github.com/ipld/go-ipld-prime/traversal/selector"
)
)
func
SpecBenchmarkWalkMapStrInt_3n
(
b
*
testing
.
B
,
nb
ipld
.
NodeBuilder
)
{
func
SpecBenchmarkWalkMapStrInt_3n
(
b
*
testing
.
B
,
nb
ipld
.
NodeBuilder
)
{
n
,
err
:=
encoding
.
Unmarshal
(
nb
,
refmtjson
.
NewDecoder
(
bytes
.
NewBufferString
(
corpus
.
Map3StrInt
())))
n
:=
must
.
Node
(
encoding
.
Unmarshal
(
nb
,
refmtjson
.
NewDecoder
(
bytes
.
NewBufferString
(
corpus
.
Map3StrInt
()))))
if
err
!=
nil
{
seldefn
:=
must
.
Node
(
encoding
.
Unmarshal
(
nb
,
refmtjson
.
NewDecoder
(
bytes
.
NewBufferString
(
`{"a":{">":{".":{}}}}`
))))
panic
(
err
)
}
seldefn
,
err
:=
encoding
.
Unmarshal
(
nb
,
refmtjson
.
NewDecoder
(
bytes
.
NewBufferString
(
`{"a":{">":{".":{}}}}`
)))
if
err
!=
nil
{
panic
(
err
)
}
sel
,
err
:=
selector
.
ParseSelector
(
seldefn
)
sel
,
err
:=
selector
.
ParseSelector
(
seldefn
)
if
err
!=
nil
{
must
.
NotError
(
err
)
panic
(
err
)
}
b
.
ResetTimer
()
b
.
ResetTimer
()
var
visitCountSanityCheck
int
var
visitCountSanityCheck
int
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
for
i
:=
0
;
i
<
b
.
N
;
i
++
{
visitCountSanityCheck
=
0
visitCountSanityCheck
=
0
...
...
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