Skip to content

Commit 4803d4b

Browse files
committed
refactor(tools): use binary.LittleEndian.PutUint64 to simplify code
1 parent 4846e80 commit 4803d4b

File tree

1 file changed

+1
-8
lines changed
  • tools/benchmark/generator

1 file changed

+1
-8
lines changed

tools/benchmark/generator/gen.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,7 @@ func (g *Generator) Close() error {
321321

322322
func encodeUint64(x uint64) []byte {
323323
var b [8]byte
324-
b[0] = byte(x)
325-
b[1] = byte(x >> 8)
326-
b[2] = byte(x >> 16)
327-
b[3] = byte(x >> 24)
328-
b[4] = byte(x >> 32)
329-
b[5] = byte(x >> 40)
330-
b[6] = byte(x >> 48)
331-
b[7] = byte(x >> 56)
324+
binary.LittleEndian.PutUint64(b[:], x)
332325
return b[:]
333326
}
334327

0 commit comments

Comments
 (0)