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

Function DecodeGeoDescending

pkg/util/encoding/encoding.go:1412–1433  ·  view source on GitHub ↗

DecodeGeoDescending decodes a geopb.SpatialObject value that was encoded in descending order back into a geopb.SpatialObject. The so parameter must already be empty/reset.

(b []byte, so *geopb.SpatialObject)

Source from the content-addressed store, hash-verified

1410// in descending order back into a geopb.SpatialObject. The so parameter
1411// must already be empty/reset.
1412func DecodeGeoDescending(b []byte, so *geopb.SpatialObject) ([]byte, error) {
1413 if PeekType(b) != GeoDesc {
1414 return nil, errors.Errorf("did not find Geo marker")
1415 }
1416 b = b[1:]
1417 var err error
1418 b, _, err = DecodeUint64Descending(b)
1419 if err != nil {
1420 return nil, err
1421 }
1422
1423 var pbBytes []byte
1424 b, pbBytes, err = decodeBytesInternal(b, pbBytes, descendingGeoEscapes, false /* expectMarker */, false /* deepCopy */)
1425 if err != nil {
1426 return b, err
1427 }
1428 onesComplement(pbBytes)
1429 // Not using protoutil.Unmarshal since the call to so.Reset() will waste the
1430 // pre-allocated EWKB.
1431 err = so.Unmarshal(pbBytes)
1432 return b, err
1433}
1434
1435// EncodeTimeTZAscending encodes a timetz.TimeTZ value and appends it to
1436// the supplied buffer and returns the final buffer.

Callers

nothing calls this directly

Calls 6

PeekTypeFunction · 0.85
DecodeUint64DescendingFunction · 0.85
decodeBytesInternalFunction · 0.85
ErrorfMethod · 0.80
onesComplementFunction · 0.70
UnmarshalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…