make StringSet.Delete accept multiple items

This commit is contained in:
deads2k
2015-01-20 12:38:08 -05:00
parent 6ff26d924c
commit 5b8e38a665
2 changed files with 28 additions and 3 deletions

View File

@@ -39,9 +39,11 @@ func (s StringSet) Insert(items ...string) {
}
}
// Delete removes item from the set.
func (s StringSet) Delete(item string) {
delete(s, item)
// Delete removes all items from the set.
func (s StringSet) Delete(items ...string) {
for _, item := range items {
delete(s, item)
}
}
// Has returns true iff item is contained in the set.