MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / compareValues

Function compareValues

go/engine/expr/parser.go:395–414  ·  view source on GitHub ↗
(a, b Value)

Source from the content-addressed store, hash-verified

393}
394
395func compareValues(a, b Value) int {
396 if a.Type == workflowapi.String || b.Type == workflowapi.String {
397 as, bs := a.AsString(), b.AsString()
398 if as < bs {
399 return -1
400 }
401 if as > bs {
402 return 1
403 }
404 return 0
405 }
406 af, bf := a.AsFloat(), b.AsFloat()
407 if af < bf {
408 return -1
409 }
410 if af > bf {
411 return 1
412 }
413 return 0
414}

Callers 2

parseEqualityMethod · 0.85
parseComparisonMethod · 0.85

Calls 2

AsStringMethod · 0.80
AsFloatMethod · 0.80

Tested by

no test coverage detected