Skip to content

Commit

Permalink
consensus/ethash: fix lint SA1019 reflect.SliceHeader
Browse files Browse the repository at this point in the history
  • Loading branch information
ziogaschr committed Jun 6, 2024
1 parent 549da55 commit cfada26
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions consensus/ethash/algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,7 @@ func generateCache(dest []uint32, epoch uint64, epochLength uint64, seed []byte)
logFn("Generated ethash verification cache", "epochLength", epochLength, "elapsed", common.PrettyDuration(elapsed))
}()
// Convert our destination slice to a byte buffer
var cache []byte
cacheHdr := (*reflect.SliceHeader)(unsafe.Pointer(&cache))
dstHdr := (*reflect.SliceHeader)(unsafe.Pointer(&dest))
cacheHdr.Data = dstHdr.Data
cacheHdr.Len = dstHdr.Len * 4
cacheHdr.Cap = dstHdr.Cap * 4
cache := unsafe.Slice((*byte)(unsafe.Pointer(&dest[0])), len(dest)*4)

// Calculate the number of theoretical rows (we'll store in one buffer nonetheless)
size := uint64(len(cache))
Expand Down

0 comments on commit cfada26

Please sign in to comment.