intersectTypeSlices returns a slice of all the types that are in both of the input slices that have the same OID.
(xs, ys []*types.T)
| 417 | // intersectTypeSlices returns a slice of all the types that are in both of the |
| 418 | // input slices that have the same OID. |
| 419 | func intersectTypeSlices(xs, ys []*types.T) (out []*types.T) { |
| 420 | seen := make(map[oid.Oid]struct{}) |
| 421 | for _, x := range xs { |
| 422 | for _, y := range ys { |
| 423 | _, ok := seen[x.Oid()] |
| 424 | if x.Oid() == y.Oid() && !ok { |
| 425 | out = append(out, x) |
| 426 | } |
| 427 | } |
| 428 | seen[x.Oid()] = struct{}{} |
| 429 | } |
| 430 | return out |
| 431 | } |
| 432 | |
| 433 | // commonConstantType returns the most constrained type which is mutually |
| 434 | // resolvable between a set of provided constants. |
no test coverage detected
searching dependent graphs…