forked from External/ergo
Use our own stringset instead of menge's
This commit is contained in:
parent
060d06ba6a
commit
e6ee9e50e0
3 changed files with 25 additions and 7 deletions
|
|
@ -15,3 +15,22 @@ func (s StringSet) Has(str string) bool {
|
|||
func (s StringSet) Add(str string) {
|
||||
s[str] = empty{}
|
||||
}
|
||||
|
||||
func (s StringSet) Remove(str string) {
|
||||
_, ok := s[str]
|
||||
if ok {
|
||||
delete(s, str)
|
||||
}
|
||||
}
|
||||
|
||||
func (s StringSet) Size() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func (s StringSet) Keys() (keys []string) {
|
||||
for key := range s {
|
||||
keys = append(keys, key)
|
||||
}
|
||||
|
||||
return keys
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue