MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / stringIndented

Method stringIndented

libs/bits/bit_array.go:311–335  ·  view source on GitHub ↗
(indent string)

Source from the content-addressed store, hash-verified

309}
310
311func (bA *BitArray) stringIndented(indent string) string {
312 lines := []string{}
313 bits := ""
314 for i := 0; i < bA.Bits; i++ {
315 if bA.getIndex(i) {
316 bits += "x"
317 } else {
318 bits += "_"
319 }
320 if i%100 == 99 {
321 lines = append(lines, bits)
322 bits = ""
323 }
324 if i%10 == 9 {
325 bits += indent
326 }
327 if i%50 == 49 {
328 bits += indent
329 }
330 }
331 if len(bits) > 0 {
332 lines = append(lines, bits)
333 }
334 return fmt.Sprintf("BA{%v:%v}", bA.Bits, strings.Join(lines, indent))
335}
336
337// Bytes returns the byte representation of the bits within the bitarray.
338func (bA *BitArray) Bytes() []byte {

Callers 1

StringIndentedMethod · 0.95

Calls 1

getIndexMethod · 0.95

Tested by

no test coverage detected