Returns a clone of the set. Does NOT clone the underlying elements.
()
| 165 | // Returns a clone of the set. |
| 166 | // Does NOT clone the underlying elements. |
| 167 | func (set StringSet) Clone() StringSet { |
| 168 | clonedSet := NewStringSet() |
| 169 | for elem := range set { |
| 170 | clonedSet.Add(elem) |
| 171 | } |
| 172 | return clonedSet |
| 173 | } |