Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wagoodman
Copy link

Add a collection which is a set (removes duplicates) however, the insertion order is preserved when obtaining a slice / iterating.

Signed-off-by: Alex Goodman <[email protected]>
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

// ToSlice returns a slice of all elements in insertion order
func (s *OrderedSet[T]) ToSlice() []T {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of or in addition ToSlice, add an iterator function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants