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

Function DecodeDurationDescending

pkg/util/encoding/encoding.go:1567–1589  ·  view source on GitHub ↗

DecodeDurationDescending is the descending version of DecodeDurationAscending.

(b []byte)

Source from the content-addressed store, hash-verified

1565
1566// DecodeDurationDescending is the descending version of DecodeDurationAscending.
1567func DecodeDurationDescending(b []byte) ([]byte, duration.Duration, error) {
1568 if PeekType(b) != Duration {
1569 return nil, duration.Duration{}, errors.Errorf("did not find marker")
1570 }
1571 b = b[1:]
1572 b, sortNanos, err := DecodeVarintDescending(b)
1573 if err != nil {
1574 return b, duration.Duration{}, err
1575 }
1576 b, months, err := DecodeVarintDescending(b)
1577 if err != nil {
1578 return b, duration.Duration{}, err
1579 }
1580 b, days, err := DecodeVarintDescending(b)
1581 if err != nil {
1582 return b, duration.Duration{}, err
1583 }
1584 d, err := duration.Decode(sortNanos, months, days)
1585 if err != nil {
1586 return b, duration.Duration{}, err
1587 }
1588 return b, d, nil
1589}
1590
1591// EncodeBitArrayAscending encodes a bitarray.BitArray value, appends it to the
1592// supplied buffer, and returns the final buffer. The encoding is guaranteed to

Callers 1

prettyPrintFirstValueFunction · 0.85

Calls 4

DecodeFunction · 0.92
PeekTypeFunction · 0.85
DecodeVarintDescendingFunction · 0.85
ErrorfMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…