promql/engine.go
func (enh *EvalNodeHelper) signatureFunc(on bool, names ...string) func(labels.Labels) uint64 {
	if enh.sigf == nil {
		enh.sigf = make(map[uint64]uint64, len(enh.out))
	}
	f := signatureFunc(on, names...)
	return func(l labels.Labels) uint64 {
		h := l.Hash()
		ret, ok := enh.sigf[h]
		if ok {
			return ret
		}
		ret = f(l)
		enh.sigf[h] = ret
		return ret
	}
}
func (enh *EvalNodeHelper) signatureFunc(on bool, names ...string) func(labels.Labels) uint64 {
	if enh.sigf == nil {
		enh.sigf = make(map[uint64]uint64, len(enh.out))
	}
	f := signatureFunc(on, names...)
	return func(l labels.Labels) uint64 {
		h := l.Hash()
		ret, ok := enh.sigf[h]
		if ok {
			return ret
		}
		ret = f(l)
		enh.sigf[h] = ret
		return ret
	}
}
func ( enh * EvalNodeHelper ) signatureFunc ( on bool , names ... string ) func ( labels . Labels ) uint64 { if enh . sigf == nil { enh . sigf = make ( map [ uint64 ] uint64 , len ( enh . out ) ) } f := signatureFunc ( on , names ... ) return func ( l labels . Labels ) uint64 { h := l . Hash ( ) ret , ok := enh . sigf [ h ] if ok { return ret } ret = f ( l ) enh . sigf [ h ] = ret return ret } }
// signatureFunc is a cached version of signatureFunc.
signatureFunc is a cached version of signatureFunc .