Skip to content

Commit

Permalink
FIX: Simplify ShallowClone outgoing mb slice
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusmihaic committed Jan 27, 2025
1 parent 5498b57 commit 3624ad4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions data/block/sovereignChainHeader.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ func (sch *SovereignChainHeader) ShallowClone() data.HeaderHandler {
headerCopy.Header = &internalHeaderCopy

if len(sch.OutGoingMiniBlockHeader) != 0 {
internalOutGoingMbHeaders := make([]OutGoingMiniBlockHeader, len(sch.OutGoingMiniBlockHeader))
for idx, outGoingMbHdr := range sch.OutGoingMiniBlockHeader {
internalOutGoingMbHeaders[idx] = outGoingMbHdr
}

headerCopy.OutGoingMiniBlockHeader = internalOutGoingMbHeaders
headerCopy.OutGoingMiniBlockHeader = make([]OutGoingMiniBlockHeader, len(sch.OutGoingMiniBlockHeader))
copy(headerCopy.OutGoingMiniBlockHeader, sch.OutGoingMiniBlockHeader)
}

return &headerCopy
Expand Down

0 comments on commit 3624ad4

Please sign in to comment.