Window returns a "window" into the Vec. A "window" is similar to Golang's slice of the current Vec from [start, end), but the returned object is NOT allowed to be modified (the modification might result in an undefined behavior).
(start int, end int)
| 346 | // allowed to be modified (the modification might result in an undefined |
| 347 | // behavior). |
| 348 | func (v *Vec) Window(start int, end int) *Vec { |
| 349 | switch v.CanonicalTypeFamily() { |
| 350 | // {{range .}} |
| 351 | case _CANONICAL_TYPE_FAMILY: |
| 352 | switch v.t.Width() { |
| 353 | // {{range .WidthOverloads}} |
| 354 | case _TYPE_WIDTH: |
| 355 | col := v.TemplateType() |
| 356 | return &Vec{ |
| 357 | t: v.t, |
| 358 | canonicalTypeFamily: v.canonicalTypeFamily, |
| 359 | col: col.Window(start, end), |
| 360 | nulls: v.nulls.Slice(start, end), |
| 361 | } |
| 362 | // {{end}} |
| 363 | } |
| 364 | // {{end}} |
| 365 | } |
| 366 | panic(fmt.Sprintf("unhandled type %s", v.t)) |
| 367 | } |
| 368 | |
| 369 | // SetValueAt is an inefficient helper to set the value in a Vec when the type |
| 370 | // is unknown. |
nothing calls this directly
no test coverage detected