| 57 | } |
| 58 | |
| 59 | S32 TSIntegerSet::count(S32 upto) const |
| 60 | { |
| 61 | AssertFatal(upto<=MAX_TS_SET_SIZE,"TSIntegerSet::count: out of range"); |
| 62 | |
| 63 | S32 count = 0; |
| 64 | U32 dword = bits[0]; |
| 65 | for (S32 i = 0; i < upto; i++) |
| 66 | { |
| 67 | // get next word |
| 68 | if (!(i & 0x1F)) |
| 69 | dword = bits[i>>5]; |
| 70 | // test bits in word |
| 71 | if (dword & (1 << (i & 0x1F))) |
| 72 | count++; |
| 73 | } |
| 74 | return count; |
| 75 | } |
| 76 | |
| 77 | void TSIntegerSet::intersect(const TSIntegerSet & otherSet) |
| 78 | { |
no outgoing calls