MCPcopy Create free account
hub / github.com/brimdata/super / walkT

Function walkT

compiler/optimizer/optimizer.go:843–861  ·  view source on GitHub ↗
(v reflect.Value, post func(T) T)

Source from the content-addressed store, hash-verified

841}
842
843func walkT[T any](v reflect.Value, post func(T) T) {
844 switch v.Kind() {
845 case reflect.Array, reflect.Slice:
846 for i := range v.Len() {
847 walkT(v.Index(i), post)
848 }
849 case reflect.Interface, reflect.Pointer:
850 walkT(v.Elem(), post)
851 case reflect.Struct:
852 for i := range v.NumField() {
853 walkT(v.Field(i), post)
854 }
855 }
856 if v.CanSet() {
857 if t, ok := v.Interface().(T); ok {
858 v.Set(reflect.ValueOf(post(t)))
859 }
860 }
861}
862
863// setPushdownUnordered walks seq, setting dag.Pushdown.Unordered to reflect
864// whether the containing scan can be unordered (i.e., need not preserve the

Callers 9

mergeFiltersFunction · 0.85
inlineRecordExprSpreadsFunction · 0.85
liftFilterOpsFunction · 0.85
mergeValuesOpsFunction · 0.85
hasThisWithEmptyPathFunction · 0.85
replaceJoinWithHashJoinFunction · 0.85
firstThisPathComponentFunction · 0.85

Calls 4

IndexMethod · 0.80
KindMethod · 0.65
LenMethod · 0.65
SetMethod · 0.45

Tested by

no test coverage detected