Ticket #7471: erase.patch

File erase.patch, 1.6 KB (added by Daniel James, 10 years ago)

Updated trunk patch

  • boost/unordered/detail/equivalent.hpp

     
    676676
    677677                    if(begin == group2) {
    678678                        link_pointer end1 = group1->group_prev_;
    679                         link_pointer end2 = group2->group_prev_;
     679                        link_pointer end2 = end->group_prev_;
    680680                        group1->group_prev_ = end2;
    681                         group2->group_prev_ = end1;
     681                        end->group_prev_ = end1;
    682682                    }
    683683                }
    684684            }
  • boost/unordered/detail/table.hpp

     
    618618            {
    619619                for(;;) {
    620620                    n = static_cast<node_pointer>(n->next_);
    621                     if (n == end) return;
     621                    if (n == end) {
     622                        if (n) {
     623                            std::size_t new_bucket_index =
     624                                policy::to_bucket(bucket_count_, n->hash_);
     625                            if (bucket_index != new_bucket_index) {
     626                                get_bucket(new_bucket_index)->next_ = prev;
     627                            }
     628                        }
     629                        return;
     630                    }
    622631
    623632                    std::size_t new_bucket_index =
    624633                        policy::to_bucket(bucket_count_, n->hash_);