| 99 | } |
| 100 | |
| 101 | S32 TSIntegerSet::start() const |
| 102 | { |
| 103 | for (S32 i=0; i<MAX_TS_SET_DWORDS; i++) |
| 104 | { |
| 105 | // search for set bit one dword at a time |
| 106 | U32 dword = bits[i]; |
| 107 | if (dword!=0) |
| 108 | { |
| 109 | // got dword, now search one byte at a time |
| 110 | S32 j = 0; |
| 111 | U32 mask = 0xFF; |
| 112 | do |
| 113 | { |
| 114 | if (dword&mask) |
| 115 | { |
| 116 | // got byte, now search one bit at a time |
| 117 | U32 bit = mask & ~(mask<<1); // grabs the smallest bit |
| 118 | do |
| 119 | { |
| 120 | if (dword&bit) |
| 121 | return (i<<5)+j; |
| 122 | j++; |
| 123 | bit <<= 1; |
| 124 | } while (1); |
| 125 | } |
| 126 | mask <<= 8; |
| 127 | j += 8; |
| 128 | } while (1); |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | return MAX_TS_SET_SIZE; |
| 133 | } |
| 134 | |
| 135 | S32 TSIntegerSet::end() const |
| 136 | { |
no outgoing calls
no test coverage detected