We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d567c5 commit f9a32bcCopy full SHA for f9a32bc
stl/ww_hashtable.h
@@ -772,7 +772,13 @@ template <
772
}
773
if (prev == nullptr) {
774
// 说明first是桶的第一个节点,直接销毁链表
775
- erase(_get_key(*first));
+ _buckets[first_bucket] = nullptr;
776
+ while (cur != nullptr) {
777
+ node_pointer next = cur->_next;
778
+ _destroy_node(cur);
779
+ cur = next;
780
+ --_num_elements;
781
+ }
782
} else {
783
// 说明first不是桶的第一个节点,从prev开始销毁
784
node_pointer cur = first._node;
0 commit comments