hashicorp / go-set

The go-set package provides generic Set implementations for Go, including HashSet for types with a Hash() function and TreeSet for orderable data
Mozilla Public License 2.0
118 stars 8 forks source link

sets: provide an Empty() method #15

Closed shoenig closed 1 year ago

shoenig commented 1 year ago

This PR expands Set and HashSet to implement an Empty() method. The method returns true if a set is empty, false otherwise. This will help cleanup some lines of code where we other wise need to do something like .Size() == 0.