| 118 | } |
| 119 | |
| 120 | func unwrapSpread(vec vector.Any) (vector.Any, []uint32, []uint32) { |
| 121 | switch vec := vec.(type) { |
| 122 | case *vector.Array: |
| 123 | return vec.Values, vec.Offsets, nil |
| 124 | case *vector.Set: |
| 125 | return vec.Values, vec.Offsets, nil |
| 126 | case *vector.View: |
| 127 | vals, offsets, _ := unwrapSpread(vec.Any) |
| 128 | return vals, offsets, vec.Index |
| 129 | } |
| 130 | return nil, nil, nil |
| 131 | } |
| 132 | |
| 133 | func mergeSameTypeVecs(sctx *super.Context, typ super.Type, tags []uint32, vecs []vector.Any) vector.Any { |
| 134 | // XXX This is going to be slow. At some point would nice to write a native |