Something went wrong. Try again.
🌱 A minimal programming language and compiler. git.urbach.dev/cli/q
Something went wrong. Try again.
1234567891011121314151617181920212223242526package 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) }
for _, value := range data.TLS { capacity += len(value) }
final := make([]byte, 0, capacity) positions := make(map[string]int, len(data.Immutable)+len(data.Mutable)+len(data.TLS)) final = appendLabeled(final, positions, data.TLS) final = data.appendImmutable(final, positions) final = data.appendMutable(final, positions) return final, positions}