Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
4a8d5d2b
Commit
4a8d5d2b
authored
May 02, 2018
by
Eli
Committed by
Péter Szilágyi
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trie: golint iterator fixes (#16639)
parent
d76c5ca5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
iterator.go
trie/iterator.go
+7
-7
No files found.
trie/iterator.go
View file @
4a8d5d2b
...
@@ -303,7 +303,7 @@ func (it *nodeIterator) push(state *nodeIteratorState, parentIndex *int, path []
...
@@ -303,7 +303,7 @@ func (it *nodeIterator) push(state *nodeIteratorState, parentIndex *int, path []
it
.
path
=
path
it
.
path
=
path
it
.
stack
=
append
(
it
.
stack
,
state
)
it
.
stack
=
append
(
it
.
stack
,
state
)
if
parentIndex
!=
nil
{
if
parentIndex
!=
nil
{
*
parentIndex
+=
1
*
parentIndex
++
}
}
}
}
...
@@ -380,7 +380,7 @@ func (it *differenceIterator) Next(bool) bool {
...
@@ -380,7 +380,7 @@ func (it *differenceIterator) Next(bool) bool {
if
!
it
.
b
.
Next
(
true
)
{
if
!
it
.
b
.
Next
(
true
)
{
return
false
return
false
}
}
it
.
count
+=
1
it
.
count
++
if
it
.
eof
{
if
it
.
eof
{
// a has reached eof, so we just return all elements from b
// a has reached eof, so we just return all elements from b
...
@@ -395,7 +395,7 @@ func (it *differenceIterator) Next(bool) bool {
...
@@ -395,7 +395,7 @@ func (it *differenceIterator) Next(bool) bool {
it
.
eof
=
true
it
.
eof
=
true
return
true
return
true
}
}
it
.
count
+=
1
it
.
count
++
case
1
:
case
1
:
// b is before a
// b is before a
return
true
return
true
...
@@ -405,12 +405,12 @@ func (it *differenceIterator) Next(bool) bool {
...
@@ -405,12 +405,12 @@ func (it *differenceIterator) Next(bool) bool {
if
!
it
.
b
.
Next
(
hasHash
)
{
if
!
it
.
b
.
Next
(
hasHash
)
{
return
false
return
false
}
}
it
.
count
+=
1
it
.
count
++
if
!
it
.
a
.
Next
(
hasHash
)
{
if
!
it
.
a
.
Next
(
hasHash
)
{
it
.
eof
=
true
it
.
eof
=
true
return
true
return
true
}
}
it
.
count
+=
1
it
.
count
++
}
}
}
}
}
}
...
@@ -504,14 +504,14 @@ func (it *unionIterator) Next(descend bool) bool {
...
@@ -504,14 +504,14 @@ func (it *unionIterator) Next(descend bool) bool {
skipped
:=
heap
.
Pop
(
it
.
items
)
.
(
NodeIterator
)
skipped
:=
heap
.
Pop
(
it
.
items
)
.
(
NodeIterator
)
// Skip the whole subtree if the nodes have hashes; otherwise just skip this node
// Skip the whole subtree if the nodes have hashes; otherwise just skip this node
if
skipped
.
Next
(
skipped
.
Hash
()
==
common
.
Hash
{})
{
if
skipped
.
Next
(
skipped
.
Hash
()
==
common
.
Hash
{})
{
it
.
count
+=
1
it
.
count
++
// If there are more elements, push the iterator back on the heap
// If there are more elements, push the iterator back on the heap
heap
.
Push
(
it
.
items
,
skipped
)
heap
.
Push
(
it
.
items
,
skipped
)
}
}
}
}
if
least
.
Next
(
descend
)
{
if
least
.
Next
(
descend
)
{
it
.
count
+=
1
it
.
count
++
heap
.
Push
(
it
.
items
,
least
)
heap
.
Push
(
it
.
items
,
least
)
}
}
...
...
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