Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaidashenko committed Sep 10, 2024
1 parent 4af52e2 commit ce20941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions core/chains/evm/headtracker/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ func (h *headsHeap) Less(i, j int) bool {
}

func (h *headsHeap) Pop() any {
old := h.values[len(h.values)-1]
h.values = h.values[:len(h.values)-1]
n := len(h.values) - 1
old := h.values[n]
h.values[n] = nil
h.values = h.values[:n]
return old
}

Expand Down
3 changes: 0 additions & 3 deletions core/chains/evm/types/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ func (h *Head) HeadAtHeight(blockNum int64) (commontypes.Head[common.Hash], erro

// ChainLength returns the length of the chain followed by recursively looking up parents
func (h *Head) ChainLength() uint32 {
if h == nil {
return 0
}
l := uint32(0)
for cur := h; cur != nil; cur = cur.Parent.Load() {
l++
Expand Down

0 comments on commit ce20941

Please sign in to comment.