| 400 | class SelectivityIterator { |
| 401 | public: |
| 402 | explicit SelectivityIterator(const SelectivityVector& rows) |
| 403 | : end_(rows.end()) { |
| 404 | vector_size_t begin = rows.begin(); |
| 405 | if (begin == end_) { |
| 406 | bits_ = nullptr; |
| 407 | current_ = 0; |
| 408 | index_ = 0; |
| 409 | return; |
| 410 | } |
| 411 | bits_ = rows.bits_.data(); |
| 412 | current_ = rows.bits_[begin / 64] & ~bits::lowMask(begin & 63); |
| 413 | if (end_ / 64 == begin / 64) { |
| 414 | current_ &= bits::lowMask(end_ & 63); |
| 415 | } |
| 416 | index_ = begin / 64; |
| 417 | } |
| 418 | |
| 419 | inline bool next(vector_size_t& row) { |
| 420 | while (current_ == 0) { |