ValueOf return the value pointer at index of list data.
(index int)
| 27 | |
| 28 | // ValueOf return the value pointer at index of list data. |
| 29 | func (l *List[T]) ValueOf(index int) (*T, bool) { |
| 30 | if index < 0 || index >= len(l.data) { |
| 31 | return nil, false |
| 32 | } |
| 33 | return &l.data[index], true |
| 34 | } |
| 35 | |
| 36 | // IndexOf returns the index of value. if not found return -1. |
| 37 | func (l *List[T]) IndexOf(value T) int { |
no outgoing calls