mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
migrate go version to 1.17 (#203)
* migrate go version to 1.17 * update contributing
This commit is contained in:
18
vendor/github.com/goccy/go-json/internal/encoder/int.go
generated
vendored
18
vendor/github.com/goccy/go-json/internal/encoder/int.go
generated
vendored
@ -49,9 +49,14 @@ var intBELookup = [100]uint16{
|
||||
|
||||
var intLookup = [2]*[100]uint16{&intLELookup, &intBELookup}
|
||||
|
||||
func AppendInt(out []byte, u64 uint64, code *Opcode) []byte {
|
||||
n := u64 & code.Mask
|
||||
negative := (u64>>code.RshiftNum)&1 == 1
|
||||
func numMask(numBitSize uint8) uint64 {
|
||||
return 1<<numBitSize - 1
|
||||
}
|
||||
|
||||
func AppendInt(_ *RuntimeContext, out []byte, u64 uint64, code *Opcode) []byte {
|
||||
mask := numMask(code.NumBitSize)
|
||||
n := u64 & mask
|
||||
negative := (u64>>(code.NumBitSize-1))&1 == 1
|
||||
if !negative {
|
||||
if n < 10 {
|
||||
return append(out, byte(n+'0'))
|
||||
@ -60,7 +65,7 @@ func AppendInt(out []byte, u64 uint64, code *Opcode) []byte {
|
||||
return append(out, byte(u), byte(u>>8))
|
||||
}
|
||||
} else {
|
||||
n = -n & code.Mask
|
||||
n = -n & mask
|
||||
}
|
||||
|
||||
lookup := intLookup[endianness]
|
||||
@ -91,8 +96,9 @@ func AppendInt(out []byte, u64 uint64, code *Opcode) []byte {
|
||||
return append(out, b[i:]...)
|
||||
}
|
||||
|
||||
func AppendUint(out []byte, u64 uint64, code *Opcode) []byte {
|
||||
n := u64 & code.Mask
|
||||
func AppendUint(_ *RuntimeContext, out []byte, u64 uint64, code *Opcode) []byte {
|
||||
mask := numMask(code.NumBitSize)
|
||||
n := u64 & mask
|
||||
if n < 10 {
|
||||
return append(out, byte(n+'0'))
|
||||
} else if n < 100 {
|
||||
|
Reference in New Issue
Block a user