MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / EncodeForwardIndex

Method EncodeForwardIndex

pkg/util/json/json.go:2051–2064  ·  view source on GitHub ↗
(buf []byte, dir encoding.Direction)

Source from the content-addressed store, hash-verified

2049}
2050
2051func (j jsonNumber) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2052 buf = encoding.EncodeJSONNumberKeyMarker(buf, dir)
2053 var dec = apd.Decimal(j)
2054 switch dir {
2055 case encoding.Ascending:
2056 buf = encoding.EncodeDecimalAscending(buf, &dec)
2057 case encoding.Descending:
2058 buf = encoding.EncodeDecimalDescending(buf, &dec)
2059 default:
2060 return nil, errors.AssertionFailedf("invalid direction")
2061 }
2062 buf = encoding.EncodeJSONKeyTerminator(buf, dir)
2063 return buf, nil
2064}
2065
2066func (j jsonFalse) EncodeForwardIndex(buf []byte, dir encoding.Direction) ([]byte, error) {
2067 buf = encoding.EncodeJSONFalseKeyMarker(buf, dir)

Callers

nothing calls this directly

Calls 5

EncodeDecimalAscendingFunction · 0.92
EncodeDecimalDescendingFunction · 0.92
EncodeJSONKeyTerminatorFunction · 0.92
DecimalMethod · 0.65

Tested by

no test coverage detected