diff options
Diffstat (limited to 'ethutil/set.go')
-rw-r--r-- | ethutil/set.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/ethutil/set.go b/ethutil/set.go deleted file mode 100644 index 7955edac0..000000000 --- a/ethutil/set.go +++ /dev/null @@ -1,36 +0,0 @@ -package ethutil - -type Settable interface { - AsSet() UniqueSet -} - -type Stringable interface { - String() string -} - -type UniqueSet map[string]struct{} - -func NewSet(v ...Stringable) UniqueSet { - set := make(UniqueSet) - for _, val := range v { - set.Insert(val) - } - - return set -} - -func (self UniqueSet) Insert(k Stringable) UniqueSet { - self[k.String()] = struct{}{} - - return self -} - -func (self UniqueSet) Include(k Stringable) bool { - _, ok := self[k.String()] - - return ok -} - -func Set(s Settable) UniqueSet { - return s.AsSet() -} |