Item returns the current element from the scope using fast paths when available.
()
| 29 | |
| 30 | // Item returns the current element from the scope using fast paths when available. |
| 31 | func (s *Scope) Item() any { |
| 32 | if s.Ints != nil { |
| 33 | return s.Ints[s.Index] |
| 34 | } |
| 35 | if s.Floats != nil { |
| 36 | return s.Floats[s.Index] |
| 37 | } |
| 38 | if s.Strings != nil { |
| 39 | return s.Strings[s.Index] |
| 40 | } |
| 41 | if s.Anys != nil { |
| 42 | return s.Anys[s.Index] |
| 43 | } |
| 44 | return s.Array.Index(s.Index).Interface() |
| 45 | } |
| 46 | |
| 47 | type groupBy = map[any][]any |
| 48 |