Skip to content

Commit

Permalink
Fix: remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Apr 8, 2021
1 parent 9807e11 commit baf03b8
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions component/gun/leb128.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@ var sevenbits = [...]byte{
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
}

func decodeUleb128(b []byte) (u uint64, n uint8) {
l := uint8(len(b) & 0xff)
// The longest LEB128 encoded sequence is 10 byte long (9 0xff's and 1 0x7f)
// so make sure we won't overflow.
if l > 10 {
l = 10
}

var i uint8
for i = 0; i < l; i++ {
u |= uint64(b[i]&0x7f) << (7 * i)
if b[i]&0x80 == 0 {
n = uint8(i + 1)
return
}
}

return
}

func appendUleb128(b []byte, v uint64) []byte {
// If it's less than or equal to 7-bit
if v < 0x80 {
Expand Down

0 comments on commit baf03b8

Please sign in to comment.