| 3709 | // Emplace/Insert |
| 3710 | |
| 3711 | inline node_pointer add_node(node_pointer n, std::size_t key_hash) |
| 3712 | { |
| 3713 | n->hash_ = key_hash; |
| 3714 | |
| 3715 | bucket_pointer b = this->get_bucket(this->hash_to_bucket(key_hash)); |
| 3716 | |
| 3717 | if (!b->next_) { |
| 3718 | link_pointer start_node = this->get_previous_start(); |
| 3719 | |
| 3720 | if (start_node->next_) { |
| 3721 | this->get_bucket(this->hash_to_bucket( |
| 3722 | node_algo::next_node(start_node)->hash_)) |
| 3723 | ->next_ = n; |
| 3724 | } |
| 3725 | |
| 3726 | b->next_ = start_node; |
| 3727 | n->next_ = start_node->next_; |
| 3728 | start_node->next_ = n; |
| 3729 | } else { |
| 3730 | n->next_ = b->next_->next_; |
| 3731 | b->next_->next_ = n; |
| 3732 | } |
| 3733 | |
| 3734 | ++this->size_; |
| 3735 | return n; |
| 3736 | } |
| 3737 | |
| 3738 | inline node_pointer resize_and_add_node( |
| 3739 | node_pointer n, std::size_t key_hash) |
no test coverage detected