MCPcopy Index your code
hub / github.com/cortexproject/cortex / WriteString

Method WriteString

pkg/cortexpb/extensions.go:42–53  ·  view source on GitHub ↗
(val string)

Source from the content-addressed store, hash-verified

40}
41
42func (s *signer) WriteString(val string) {
43 switch {
44 case len(s.b)+len(val) > cap(s.b):
45 // If labels val does not fit in the []byte we fall back to not allocate the whole entry.
46 _, _ = s.h.Write(s.b)
47 s.b = s.b[:0]
48 s.b = append(s.b, val...)
49 default:
50 // Use xxhash.Sum64(b) for fast path as it's faster.
51 s.b = append(s.b, val...)
52 }
53}
54
55func (s *signer) Sum64() uint64 {
56 _, _ = s.h.Write(s.b)

Callers 15

writeConfigBlockMethod · 0.80
writeConfigEntryMethod · 0.80
writeFlagMethod · 0.80
writeCommentMethod · 0.80
writeConfigBlockMethod · 0.80
LogMethod · 0.80
TestSetPasswordFunction · 0.80
SampleJsoniterEncodeFunction · 0.80
SignMethod · 0.80
writeToMethod · 0.80

Calls 1

WriteMethod · 0.45