MCPcopy Create free account
hub / github.com/bodgit/sevenzip / readOptionalBool

Function readOptionalBool

types.go:145–165  ·  view source on GitHub ↗
(r io.ByteReader, count uint64)

Source from the content-addressed store, hash-verified

143}
144
145func readOptionalBool(r io.ByteReader, count uint64) ([]bool, error) {
146 if err := checkUint64(count, true); err != nil {
147 return nil, err
148 }
149
150 all, err := r.ReadByte()
151 if err != nil {
152 return nil, fmt.Errorf("readOptionalBool: ReadByte error: %w", err)
153 }
154
155 if all == 0 {
156 return readBool(r, count)
157 }
158
159 defined := make([]bool, count)
160 for i := range defined {
161 defined[i] = true
162 }
163
164 return defined, nil
165}
166
167func readSizes(r io.ByteReader, count uint64) ([]uint64, error) {
168 if err := checkUint64(count, true); err != nil {

Callers 3

readCRCFunction · 0.85
readTimesFunction · 0.85
readAttributesFunction · 0.85

Calls 3

checkUint64Function · 0.85
readBoolFunction · 0.85
ReadByteMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…