Skip to content

Commit

Permalink
Get rid of unused func
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <mattalord@gmail.com>
  • Loading branch information
mattlord committed Dec 10, 2024
1 parent 69afa52 commit 42d5db4
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions go/mysql/binlog/binlog_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,45 +471,3 @@ func binparserObject(typ jsonDataType, data []byte, pos int) (node *json.Value,

return json.NewObject(object), nil
}

func readLenEncInt(data []byte, pos int) (uint64, int, bool) {
if pos >= len(data) {
return 0, 0, false
}

// reslice to avoid arithmetic below
data = data[pos:]

switch data[0] {
case 0xfc:
// Encoded in the next 2 bytes.
if 2 >= len(data) {
return 0, 0, false
}
return uint64(data[1]) |
uint64(data[2])<<8, pos + 3, true
case 0xfd:
// Encoded in the next 3 bytes.
if 3 >= len(data) {
return 0, 0, false
}
return uint64(data[1]) |
uint64(data[2])<<8 |
uint64(data[3])<<16, pos + 4, true
case 0xfe:
// Encoded in the next 8 bytes.
if 8 >= len(data) {
return 0, 0, false
}
return uint64(data[1]) |
uint64(data[2])<<8 |
uint64(data[3])<<16 |
uint64(data[4])<<24 |
uint64(data[5])<<32 |
uint64(data[6])<<40 |
uint64(data[7])<<48 |
uint64(data[8])<<56, pos + 9, true
default:
return uint64(data[0]), pos + 1, true
}
}

0 comments on commit 42d5db4

Please sign in to comment.