extractTopics returns the unique list of topics represented by the set of provided members.
(members []GroupMember)
| 1583 | // extractTopics returns the unique list of topics represented by the set of |
| 1584 | // provided members. |
| 1585 | func extractTopics(members []GroupMember) []string { |
| 1586 | visited := map[string]struct{}{} |
| 1587 | var topics []string |
| 1588 | |
| 1589 | for _, member := range members { |
| 1590 | for _, topic := range member.Topics { |
| 1591 | if _, seen := visited[topic]; seen { |
| 1592 | continue |
| 1593 | } |
| 1594 | |
| 1595 | topics = append(topics, topic) |
| 1596 | visited[topic] = struct{}{} |
| 1597 | } |
| 1598 | } |
| 1599 | |
| 1600 | sort.Strings(topics) |
| 1601 | |
| 1602 | return topics |
| 1603 | } |
| 1604 | |
| 1605 | type humanOffset int64 |
| 1606 |
no outgoing calls