Skip to content

Commit

Permalink
Simplify itob
Browse files Browse the repository at this point in the history
  • Loading branch information
phbnf committed Sep 2, 2024
1 parent 6ce3359 commit c48cf39
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions personalities/sctfe/storage/bbolt/dedup.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ func (s *Storage) LogSize() (uint64, error) {

// itob returns an 8-byte big endian representation of idx.
func itob(idx uint64) []byte {
b := make([]byte, 8)
binary.BigEndian.PutUint64(b, uint64(idx))
return b
return binary.BigEndian.AppendUint64(nil, idx)
}

// btoi converts a byte array to a uint64
Expand Down

0 comments on commit c48cf39

Please sign in to comment.