MCPcopy
hub / github.com/google/codesearch / writeString

Method writeString

index/write.go:504–516  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

502}
503
504func (b *bufWriter) writeString(s string) {
505 n := cap(b.buf) - len(b.buf)
506 if len(s) > n {
507 b.flush()
508 if len(s) >= cap(b.buf) {
509 if _, err := b.file.WriteString(s); err != nil {
510 log.Fatalf("writing %s: %v", b.name, err)
511 }
512 return
513 }
514 }
515 b.buf = append(b.buf, s...)
516}
517
518// offset returns the current write offset.
519func (b *bufWriter) offset() uint32 {

Callers 3

MergeFunction · 0.80
FlushMethod · 0.80
addNameMethod · 0.80

Calls 1

flushMethod · 0.95

Tested by

no test coverage detected