MCPcopy Index your code
hub / github.com/google/mangle / HashConstants

Function HashConstants

ast/ast.go:842–851  ·  view source on GitHub ↗

HashConstants hashes a slice of constants.

(constants []Constant)

Source from the content-addressed store, hash-verified

840
841// HashConstants hashes a slice of constants.
842func HashConstants(constants []Constant) uint64 {
843 if len(constants) == 0 {
844 return 0
845 }
846 h := constants[0].Hash()
847 for _, snd := range constants[1:] {
848 h = szudzikElegantPair(h, snd.Hash())
849 }
850 return h
851}
852
853// EqualsConstants compares two slices of constants.
854func EqualsConstants(left []Constant, right []Constant) bool {

Callers 1

EvalReduceFnFunction · 0.92

Calls 2

szudzikElegantPairFunction · 0.85
HashMethod · 0.65

Tested by

no test coverage detected