MCPcopy
hub / github.com/pingcap/tidb / EncodeInt

Function EncodeInt

pkg/util/codec/number.go:38–43  ·  view source on GitHub ↗

EncodeInt appends the encoded value to slice b and returns the appended slice. EncodeInt guarantees that the encoded value is in ascending order for comparison.

(b []byte, v int64)

Source from the content-addressed store, hash-verified

36// EncodeInt appends the encoded value to slice b and returns the appended slice.
37// EncodeInt guarantees that the encoded value is in ascending order for comparison.
38func EncodeInt(b []byte, v int64) []byte {
39 var data [8]byte
40 u := EncodeIntToCmpUint(v)
41 binary.BigEndian.PutUint64(data[:], u)
42 return append(b, data[:]...)
43}
44
45// EncodeIntDesc appends the encoded value to slice b and returns the appended slice.
46// EncodeIntDesc guarantees that the encoded value is in descending order for comparison.

Callers 15

buildMethod · 0.92
HashCodeMethod · 0.92
hashInt64Uint64MapFunction · 0.92
NewPlanCacheKeyFunction · 0.92
hashCodeMethod · 0.92
HashCodeMethod · 0.92
EncodedMethod · 0.92
buildNEIntExprFunction · 0.92
buildEQIntExprFunction · 0.92
RemoveRecordMethod · 0.92

Calls 1

EncodeIntToCmpUintFunction · 0.70

Tested by 15

buildMethod · 0.74
buildNEIntExprFunction · 0.74
buildEQIntExprFunction · 0.74
getExpectedRangesFunction · 0.74
TestTableCodecFunction · 0.74
TestTableCodecInvalidFunction · 0.74
TestRecordKeyFunction · 0.74
TestPBToExprFunction · 0.74