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

Function DecodeGeoAscending

pkg/util/encoding/encoding.go:1387–1407  ·  view source on GitHub ↗

DecodeGeoAscending decodes a geopb.SpatialObject value that was encoded in ascending 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

1385// in ascending order back into a geopb.SpatialObject. The so parameter
1386// must already be empty/reset.
1387func DecodeGeoAscending(b []byte, so *geopb.SpatialObject) ([]byte, error) {
1388 if PeekType(b) != Geo {
1389 return nil, errors.Errorf("did not find Geo marker")
1390 }
1391 b = b[1:]
1392 var err error
1393 b, _, err = DecodeUint64Ascending(b)
1394 if err != nil {
1395 return nil, err
1396 }
1397
1398 var pbBytes []byte
1399 b, pbBytes, err = decodeBytesInternal(b, pbBytes, ascendingGeoEscapes, false /* expectMarker */, false /* deepCopy */)
1400 if err != nil {
1401 return b, err
1402 }
1403 // Not using protoutil.Unmarshal since the call to so.Reset() will waste the
1404 // pre-allocated EWKB.
1405 err = so.Unmarshal(pbBytes)
1406 return b, err
1407}
1408
1409// DecodeGeoDescending decodes a geopb.SpatialObject value that was encoded
1410// in descending order back into a geopb.SpatialObject. The so parameter

Callers

nothing calls this directly

Calls 5

PeekTypeFunction · 0.85
DecodeUint64AscendingFunction · 0.85
decodeBytesInternalFunction · 0.85
ErrorfMethod · 0.80
UnmarshalMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…