| 187 | } |
| 188 | |
| 189 | inline HashTable::Iterator HashTable::FirstUnmatched(HashTableCtx* ctx) { |
| 190 | int64_t bucket_idx = Iterator::BUCKET_NOT_FOUND; |
| 191 | DuplicateNode* node = NULL; |
| 192 | NextFilledBucket(&bucket_idx, &node); |
| 193 | Iterator it(this, ctx->scratch_row(), bucket_idx, node); |
| 194 | // Check whether the bucket, or its first duplicate node, is matched. If it is not |
| 195 | // matched, then return. Otherwise, move to the first unmatched entry (node or bucket). |
| 196 | Bucket* bucket = &buckets_[bucket_idx]; |
| 197 | bool has_duplicates = stores_duplicates() && bucket->HasDuplicates(); |
| 198 | if ((!has_duplicates && bucket->IsMatched()) || (has_duplicates && node->IsMatched())) { |
| 199 | it.NextUnmatched(); |
| 200 | } |
| 201 | return it; |
| 202 | } |
| 203 | |
| 204 | inline void HashTable::NextFilledBucket(int64_t* bucket_idx, DuplicateNode** node) { |
| 205 | ++*bucket_idx; |
no test coverage detected