| 381 | } |
| 382 | |
| 383 | inline void HashTable::Iterator::NextUnmatched() { |
| 384 | DCHECK(!AtEnd()); |
| 385 | Bucket* bucket = &table_->buckets_[bucket_idx_]; |
| 386 | // Check if there is any remaining unmatched duplicate node in the current bucket. |
| 387 | if (table_->stores_duplicates() && bucket->HasDuplicates()) { |
| 388 | auto next_node = node_->Next(); |
| 389 | while (next_node != NULL) { |
| 390 | node_ = next_node; |
| 391 | if (!node_->IsMatched()) return; |
| 392 | next_node = next_node->Next(); |
| 393 | } |
| 394 | } |
| 395 | // Move to the next filled bucket and return if this bucket is not matched or |
| 396 | // iterate to the first not matched duplicate node. |
| 397 | table_->NextFilledBucket(&bucket_idx_, &node_); |
| 398 | while (bucket_idx_ != Iterator::BUCKET_NOT_FOUND) { |
| 399 | bucket = &table_->buckets_[bucket_idx_]; |
| 400 | if (!table_->stores_duplicates() || !bucket->HasDuplicates()) { |
| 401 | if (!bucket->IsMatched()) return; |
| 402 | } else { |
| 403 | auto next_node = node_->Next(); |
| 404 | while (node_->IsMatched() && next_node != NULL) { |
| 405 | node_ = next_node; |
| 406 | next_node = next_node->Next(); |
| 407 | } |
| 408 | if (!node_->IsMatched()) return; |
| 409 | } |
| 410 | table_->NextFilledBucket(&bucket_idx_, &node_); |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | inline void HashTableCtx::set_level(int level) { |
| 415 | DCHECK_GE(level, 0); |
no test coverage detected