MCPcopy Create free account
hub / github.com/akyoto/q / appendMutable

Method appendMutable

src/data/appendMutable.go:10–32  ·  view source on GitHub ↗

appendMutable adds data that is mutable and not subject to string interning.

(final []byte, positions map[string]int)

Source from the content-addressed store, hash-verified

8
9// appendMutable adds data that is mutable and not subject to string interning.
10func (data *Data) appendMutable(final []byte, positions map[string]int) []byte {
11 keys := make([]string, 0, len(data.Mutable))
12
13 for key := range data.Mutable {
14 keys = append(keys, key)
15 }
16
17 slices.Sort(keys)
18
19 for _, key := range keys {
20 content := data.Mutable[key]
21 final = exe.PadSlice(final, len(content))
22 positions[key] = len(final)
23 final = append(final, content...)
24 }
25
26 return final
27}

Callers 1

FinalizeMethod · 0.95

Calls 1

AlignPadFunction · 0.92

Tested by

no test coverage detected