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.
123456789101112131415161718192021package data
// Finalize returns the final raw data slice and a map of labels with their respective indices.// It will try to reuse existing data whenever possible.func (data *Data) Finalize() ([]byte, map[string]int) { capacity := 0
for _, value := range data.Immutable { capacity += len(value) }
for _, value := range data.Mutable { capacity += len(value) }
final := make([]byte, 0, capacity) positions := make(map[string]int, len(data.Immutable)+len(data.Mutable)) final = data.appendImmutable(final, positions) final = data.appendMutable(final, positions) return final, positions}