MCPcopy
hub / github.com/google/go-jsonnet / makeValueArray

Function makeValueArray

value.go:304–317  ·  view source on GitHub ↗
(elements []*cachedThunk)

Source from the content-addressed store, hash-verified

302}
303
304func makeValueArray(elements []*cachedThunk) *valueArray {
305 // We don't want to keep a bigger array than necessary
306 // so we create a new one with minimal capacity
307 var arrayElems []*cachedThunk
308 if len(elements) == cap(elements) {
309 arrayElems = elements
310 } else {
311 arrayElems = make([]*cachedThunk, len(elements))
312 copy(arrayElems, elements)
313 }
314 return &valueArray{
315 elements: arrayElems,
316 }
317}
318
319func concatArrays(a, b *valueArray) *valueArray {
320 result := make([]*cachedThunk, 0, len(a.elements)+len(b.elements))

Callers 15

builtinMakeArrayFunction · 0.85
builtinFlatMapFunction · 0.85
joinArraysFunction · 0.85
builtinReverseFunction · 0.85
builtinFilterFunction · 0.85
builtinSortFunction · 0.85
builtinRangeFunction · 0.85
builtinEncodeUTF8Function · 0.85
builtinObjectFieldsExFunction · 0.85
builtinSplitLimitFunction · 0.85
builtinSplitLimitRFunction · 0.85
builtinBase64DecodeBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…