Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for DominantField (0.12 sec)

  1. staging/src/k8s.io/apimachinery/third_party/forked/golang/json/fields.go

    		if advance == 1 { // Only one field with this name
    			out = append(out, fi)
    			continue
    		}
    		dominant, ok := dominantField(fields[i : i+advance])
    		if ok {
    			out = append(out, dominant)
    		}
    	}
    
    	fields = out
    	sort.Sort(byIndex(fields))
    
    	return fields
    }
    
    // dominantField looks through the fields, all of which are known to
    // have the same name, to find the single field that dominates the
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 13.1K bytes
    - Viewed (0)
  2. src/encoding/json/encode.go

    			fj := fields[i+advance]
    			if fj.name != name {
    				break
    			}
    		}
    		if advance == 1 { // Only one field with this name
    			out = append(out, fi)
    			continue
    		}
    		dominant, ok := dominantField(fields[i : i+advance])
    		if ok {
    			out = append(out, dominant)
    		}
    	}
    
    	fields = out
    	slices.SortFunc(fields, func(i, j field) int {
    		return slices.Compare(i.index, j.index)
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  3. src/encoding/json/encode_test.go

    			type (
    				S1 struct{ x, X int }
    				S2 struct{ x, X int }
    				S  struct {
    					S1
    					S2
    				}
    			)
    			return S{S1{1, 2}, S2{3, 4}}
    		},
    		want: `{}`,
    	}, {
    		CaseName: Name("DominantField"),
    		// Both S1 and S2 have a field named X, but since S has an X field as
    		// well, it takes precedence over S1.X and S2.X.
    		makeInput: func() any {
    			type (
    				S1 struct{ x, X int }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
Back to top