MCPcopy Create free account
hub / github.com/cel-expr/cel-go / hashCall

Function hashCall

interpreter/async.go:202–208  ·  view source on GitHub ↗

hashCall computes the composite bucket key for an async call. Only string, int, double, uint, and bool argument values contribute to the hash. More complex types rely on a richer notion of equivalence (e.g. unordered maps, proto equality, custom types) that a byte-level hash cannot capture safely,

(id int64, overload string, args []ref.Val)

Source from the content-addressed store, hash-verified

200// that a byte-level hash cannot capture safely, so they are intentionally excluded from the key
201// and are instead disambiguated within the bucket by asyncCallState.matches.
202func hashCall(id int64, overload string, args []ref.Val) uint64 {
203 result := 31*uint64(id) + hashString(overload)
204 for _, arg := range args {
205 result = 31*result + hashArg(arg)
206 }
207 return result
208}
209
210// findInBucket returns the call state in the bucket matching the same node id and call identity,
211// or nil if no match is present.

Callers 3

getOrCreateMethod · 0.85
TestHashCallFunction · 0.85
TestHashCallInvariantsFunction · 0.85

Calls 2

hashStringFunction · 0.85
hashArgFunction · 0.85

Tested by 2

TestHashCallFunction · 0.68
TestHashCallInvariantsFunction · 0.68