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

Function DecodeIfNotNull

pkg/util/encoding/encoding.go:1197–1202  ·  view source on GitHub ↗

DecodeIfNotNull decodes a not-NULL value from the input buffer. If the input buffer contains a not-NULL marker at the start of the buffer then it is removed from the buffer and true is returned for the second result. Otherwise, the buffer is returned unchanged and false is returned for the second re

(b []byte)

Source from the content-addressed store, hash-verified

1195// distinguish not-NULL from the empty string.
1196// This function handles both ascendingly and descendingly encoded NULLs.
1197func DecodeIfNotNull(b []byte) ([]byte, bool) {
1198 if PeekType(b) == NotNull {
1199 return b[1:], true
1200 }
1201 return b, false
1202}
1203
1204// EncodeTimeAscending encodes a time value, appends it to the supplied buffer,
1205// and returns the final buffer. The encoding is guaranteed to be ordered

Callers 1

prettyPrintFirstValueFunction · 0.85

Calls 1

PeekTypeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…