Add adds the non-negative value x to the set.
(x int)
| 27 | |
| 28 | // Add adds the non-negative value x to the set. |
| 29 | func (s *IntSet) Add(x int) { |
| 30 | word, bit := x/64, uint(x%64) |
| 31 | for word >= len(s.words) { |
| 32 | s.words = append(s.words, 0) |
| 33 | } |
| 34 | s.words[word] |= 1 << bit |
| 35 | } |
| 36 | |
| 37 | // UnionWith sets s to the union of s and t. |
| 38 | func (s *IntSet) UnionWith(t *IntSet) { |
no outgoing calls