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

Function Parse

pkg/util/bitarray/bitarray.go:317–326  ·  view source on GitHub ↗

Parse parses a bit array from the specified string.

(s string)

Source from the content-addressed store, hash-verified

315
316// Parse parses a bit array from the specified string.
317func Parse(s string) (res BitArray, err error) {
318 if len(s) == 0 {
319 return res, nil
320 }
321
322 if s[0] == 'x' || s[0] == 'X' {
323 return parseFromHex(s[1:])
324 }
325 return parseFromBinary(s)
326}
327
328func parseFromBinary(s string) (res BitArray, err error) {
329 words, lastBitsUsed := EncodingPartsForBitLen(uint(len(s)))

Callers 1

ParseDBitArrayFunction · 0.92

Calls 2

parseFromHexFunction · 0.85
parseFromBinaryFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…