| 245 | } |
| 246 | |
| 247 | void TSIntegerSet::erase(S32 index) |
| 248 | { |
| 249 | AssertFatal(index<MAX_TS_SET_SIZE,"TSIntegerSet::erase: out of range"); |
| 250 | |
| 251 | // shift to erase bit in target word |
| 252 | S32 word = index >> 5; |
| 253 | U32 lowMask = (1 << (index & 0x1f)) - 1; // bits below the erase point |
| 254 | |
| 255 | bits[word] = ((bits[word] >> 1) & ~lowMask) | (bits[word] & lowMask); |
| 256 | |
| 257 | // shift bits in words after the erase point |
| 258 | U32 endWord = (end() >> 5) + 1; |
| 259 | if (endWord >= MAX_TS_SET_DWORDS) |
| 260 | endWord = MAX_TS_SET_DWORDS-1; |
| 261 | |
| 262 | for (S32 i = (index >> 5) + 1; i <= endWord; i++) |
| 263 | { |
| 264 | if (bits[i] & 0x1) |
| 265 | bits[i-1] |= 0x80000000; |
| 266 | bits[i] = bits[i] >> 1; |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | TSIntegerSet::TSIntegerSet() |
| 271 | { |
no test coverage detected