~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/intset.py

  • Committer: John Arbash Meinel
  • Author(s): Mark Hammond
  • Date: 2008-09-09 17:02:21 UTC
  • mto: This revision was merged to the branch mainline in revision 3697.
  • Revision ID: john@arbash-meinel.com-20080909170221-svim3jw2mrz0amp3
An updated transparent icon for bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
 
151
151
    def __contains__(self, i):
152
 
        assert i >= 0
153
152
        return self._val & (1L << i)
154
153
 
155
154
 
177
176
            self._val |= to_add._val
178
177
        else:
179
178
            for i in to_add:
180
 
                assert i >= 0
181
179
                self._val |= (1L << i)
182
180
 
183
181
 
184
182
    def add(self, to_add):
185
 
        assert 0 <= to_add
186
183
        self._val |= (1L << to_add)
187
184
 
188
185
 
203
200
        >>> not a
204
201
        True
205
202
        """
206
 
        assert 0 <= to_remove
207
203
        m = 1L << to_remove
208
204
        if not self._val & m:
209
205
            raise KeyError(to_remove)