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

Function arrayCmp

builtins.go:163–182  ·  view source on GitHub ↗
(i *interpreter, x, y *valueArray)

Source from the content-addressed store, hash-verified

161}
162
163func arrayCmp(i *interpreter, x, y *valueArray) (int, error) {
164 for index := 0; index < minInt(x.length(), y.length()); index++ {
165 left, err := x.index(i, index)
166 if err != nil {
167 return 0, err
168 }
169 right, err := y.index(i, index)
170 if err != nil {
171 return 0, err
172 }
173 cmp, err := valueCmp(i, left, right)
174 if err != nil {
175 return 0, err
176 }
177 if cmp != 0 {
178 return cmp, nil
179 }
180 }
181 return intCmp(x.length(), y.length()), nil
182}
183
184func builtinLess(i *interpreter, x, y value) (value, error) {
185 r, err := valueCmp(i, x, y)

Callers 1

valueCmpFunction · 0.85

Calls 5

minIntFunction · 0.85
valueCmpFunction · 0.85
intCmpFunction · 0.85
lengthMethod · 0.65
indexMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…