We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d4478f commit b87793dCopy full SHA for b87793d
threadunsafe.go
@@ -57,8 +57,12 @@ func (pair *OrderedPair) Equal(other OrderedPair) bool {
57
58
func (set *threadUnsafeSet) Add(i interface{}) bool {
59
_, found := (*set)[i]
60
+ if found {
61
+ return false //False if it existed already
62
+ }
63
+
64
(*set)[i] = struct{}{}
- return !found //False if it existed already
65
+ return true
66
}
67
68
func (set *threadUnsafeSet) Contains(i ...interface{}) bool {
0 commit comments