Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
123456789101112131415161718192021222324252627package data
import ( "slices"
"git.urbach.dev/cli/q/src/exe")
// appendMutable adds data that is mutable and not subject to string interning.func (data *Data) appendMutable(final []byte, positions map[string]int) []byte { keys := make([]string, 0, len(data.Mutable))
for key := range data.Mutable { keys = append(keys, key) }
slices.Sort(keys)
for _, key := range keys { content := data.Mutable[key] final = exe.PadSlice(final, len(content)) positions[key] = len(final) final = append(final, content...) }
return final}