FirstSegment returns the first segment in the set. If the set is empty, FirstSegment returns a terminal iterator.
()
| 172 | // FirstSegment returns the first segment in the set. If the set is empty, |
| 173 | // FirstSegment returns a terminal iterator. |
| 174 | func (s *Set) FirstSegment() Iterator { |
| 175 | if s.root.nrSegments == 0 { |
| 176 | return Iterator{} |
| 177 | } |
| 178 | return s.root.firstSegment() |
| 179 | } |
| 180 | |
| 181 | // LastSegment returns the last segment in the set. If the set is empty, |
| 182 | // LastSegment returns a terminal iterator. |