Skip to content

Commit 7fe0f17

Browse files
committed
trie: more linters ethereum#24783
1 parent d91032d commit 7fe0f17

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

trie/proof.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,23 +367,25 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
367367
// branch. The parent must be a fullnode.
368368
fn := parent.(*fullNode)
369369
fn.Children[key[pos-1]] = nil
370-
} else {
371-
// The key of fork shortnode is greater than the
372-
// path(it doesn't belong to the range), keep
373-
// it with the cached hash available.
374370
}
371+
//else {
372+
// The key of fork shortnode is greater than the
373+
// path(it doesn't belong to the range), keep
374+
// it with the cached hash available.
375+
//}
375376
} else {
376377
if bytes.Compare(cld.Key, key[pos:]) > 0 {
377378
// The key of fork shortnode is greater than the
378379
// path(it belongs to the range), unset the entrie
379380
// branch. The parent must be a fullnode.
380381
fn := parent.(*fullNode)
381382
fn.Children[key[pos-1]] = nil
382-
} else {
383-
// The key of fork shortnode is less than the
384-
// path(it doesn't belong to the range), keep
385-
// it with the cached hash available.
386383
}
384+
//else {
385+
// The key of fork shortnode is less than the
386+
// path(it doesn't belong to the range), keep
387+
// it with the cached hash available.
388+
//}
387389
}
388390
return nil
389391
}

trie/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func newTracer() *tracer {
5050
}
5151
}
5252

53+
/*
5354
// onRead tracks the newly loaded trie node and caches the rlp-encoded blob internally.
5455
// Don't change the value outside of function since it's not deep-copied.
5556
func (t *tracer) onRead(key []byte, val []byte) {
@@ -59,6 +60,7 @@ func (t *tracer) onRead(key []byte, val []byte) {
5960
}
6061
t.origin[string(key)] = val
6162
}
63+
*/
6264

6365
// onInsert tracks the newly inserted trie node. If it's already in the deletion set
6466
// (resurrected node), then just wipe it from the deletion set as the "untouched".
@@ -115,6 +117,7 @@ func (t *tracer) deleteList() [][]byte {
115117
return ret
116118
}
117119

120+
/*
118121
// getPrev returns the cached original value of the specified node.
119122
func (t *tracer) getPrev(key []byte) []byte {
120123
// Don't panic on uninitialized tracer, it's possible in testing.
@@ -123,6 +126,7 @@ func (t *tracer) getPrev(key []byte) []byte {
123126
}
124127
return t.origin[string(key)]
125128
}
129+
*/
126130

127131
// reset clears the content tracked by tracer.
128132
func (t *tracer) reset() {

0 commit comments

Comments
 (0)