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

Function stringCmp

value.go:202–217  ·  view source on GitHub ↗
(a, b valueString)

Source from the content-addressed store, hash-verified

200}
201
202func stringCmp(a, b valueString) int {
203 runesA := a.getRunes()
204 runesB := b.getRunes()
205 var length int
206 if len(runesA) < len(runesB) {
207 length = len(runesA)
208 } else {
209 length = len(runesB)
210 }
211 for i := 0; i < length; i++ {
212 if runesA[i] != runesB[i] {
213 return runeCmp(runesA[i], runesB[i])
214 }
215 }
216 return intCmp(len(runesA), len(runesB))
217}
218
219func stringEqual(a, b valueString) bool {
220 runesA := a.getRunes()

Callers 1

valueCmpFunction · 0.85

Calls 3

runeCmpFunction · 0.85
intCmpFunction · 0.85
getRunesMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…