Convert "1.2.3" to int[]{0, 1, 2} ready for indexing into TaskNodes
(index string)
| 315 | |
| 316 | // Convert "1.2.3" to int[]{0, 1, 2} ready for indexing into TaskNodes |
| 317 | func indexFromString(index string) Index { |
| 318 | tokens := strings.Split(index, ".") |
| 319 | numericIndex := make(Index, len(tokens)) |
| 320 | for i, token := range tokens { |
| 321 | value, err := strconv.Atoi(token) |
| 322 | if err != nil || value < 1 { |
| 323 | return nil |
| 324 | } |
| 325 | numericIndex[i] = value - 1 |
| 326 | } |
| 327 | return numericIndex |
| 328 | } |
| 329 | |
| 330 | func (t *taskListImpl) ID() int { |
| 331 | return -1 |
no outgoing calls