(fvec vector.Any, tvec vector.Any)
| 122 | } |
| 123 | |
| 124 | func (s *Strftime) fastPath(fvec vector.Any, tvec vector.Any) vector.Any { |
| 125 | format := vector.StringValue(fvec, 0) |
| 126 | f, err := strftime.New(format) |
| 127 | if err != nil { |
| 128 | return vector.NewWrappedError(s.sctx, "strftime: "+err.Error(), fvec) |
| 129 | } |
| 130 | switch tvec := tvec.(type) { |
| 131 | case *vector.Int: |
| 132 | return s.fastPathLoop(f, tvec, nil) |
| 133 | case *vector.Const: |
| 134 | t := vector.IntValue(tvec, 0) |
| 135 | s := f.FormatString(nano.Ts(t).Time()) |
| 136 | return vector.NewConstString(s, tvec.Len()) |
| 137 | case *vector.View: |
| 138 | return s.fastPathLoop(f, tvec.Any.(*vector.Int), tvec.Index) |
| 139 | case *vector.Dict: |
| 140 | vec := s.fastPathLoop(f, tvec.Any.(*vector.Int), nil) |
| 141 | return vector.NewDict(vec, tvec.Index, tvec.Counts) |
| 142 | default: |
| 143 | panic(tvec) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func (s *Strftime) fastPathLoop(f *strftime.Strftime, vec *vector.Int, index []uint32) *vector.String { |
| 148 | if index != nil { |
no test coverage detected