Skip to content

Commit

Permalink
encoding: simplify code wrt to the 16b input
Browse files Browse the repository at this point in the history
It doesn't change emitted asm anyway.
Max uint16 value shifted 8b right can't be bigger than 0xff.
  • Loading branch information
wkhere committed Nov 5, 2024
1 parent 6c41208 commit d850161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func u16ToBytes(p []byte, x uint16) {
p[0] = byte(x >> 8 & 0xff)
p[0] = byte(x >> 8)
p[1] = byte(x & 0xff)
}

Expand Down

0 comments on commit d850161

Please sign in to comment.