Skip to content

Commit

Permalink
*: Use AppendUint64 for byte slice appending
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Karpy <[email protected]>
  • Loading branch information
carpawell committed Sep 18, 2023
1 parent 8909b50 commit 9f76159
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
7 changes: 1 addition & 6 deletions pkg/innerring/processors/governance/process_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ func (gp *Processor) processAlphabetSync(txHash util.Uint256) {
}

// 4. Update NeoFS contract in the mainnet.
epoch := gp.epochState.EpochCounter()

buf := make([]byte, 8)
binary.LittleEndian.PutUint64(buf, epoch)

id := append([]byte(alphabetUpdateIDPrefix), buf...)
id := binary.LittleEndian.AppendUint64([]byte(alphabetUpdateIDPrefix), gp.epochState.EpochCounter())

prm := neofscontract.AlphabetUpdatePrm{}

Expand Down
7 changes: 2 additions & 5 deletions pkg/local_object_storage/pilorama/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,11 +927,8 @@ func internalKey(key []byte, k, v string, parent, node Node) []byte {
key = append(key, byte(l), byte(l>>8))
key = append(key, v...)

var raw [8]byte
binary.LittleEndian.PutUint64(raw[:], parent)
key = append(key, raw[:]...)
key = binary.LittleEndian.AppendUint64(key, parent)
key = binary.LittleEndian.AppendUint64(key, node)

binary.LittleEndian.PutUint64(raw[:], node)
key = append(key, raw[:]...)
return key
}

0 comments on commit 9f76159

Please sign in to comment.