Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions libcxx/include/__vector/vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class _LIBCPP_TEMPLATE_VIS vector {

_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() {
if (__vec_.__begin_ != nullptr) {
__vec_.__clear();
__vec_.clear();
__vec_.__annotate_delete();
__alloc_traits::deallocate(__vec_.__alloc_, __vec_.__begin_, __vec_.capacity());
}
Expand Down Expand Up @@ -520,7 +520,7 @@ class _LIBCPP_TEMPLATE_VIS vector {

_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void clear() _NOEXCEPT {
size_type __old_size = size();
__clear();
__base_destruct_at_end(this->__begin_);
__annotate_shrink(__old_size);
}

Expand Down Expand Up @@ -732,10 +732,6 @@ class _LIBCPP_TEMPLATE_VIS vector {
++__tx.__pos_;
}

_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __clear() _NOEXCEPT {
__base_destruct_at_end(this->__begin_);
}

_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __base_destruct_at_end(pointer __new_last) _NOEXCEPT {
pointer __soon_to_be_end = this->__end_;
while (__new_last != __soon_to_be_end)
Expand All @@ -759,7 +755,7 @@ class _LIBCPP_TEMPLATE_VIS vector {

_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __copy_assign_alloc(const vector& __c, true_type) {
if (this->__alloc_ != __c.__alloc_) {
__clear();
clear();
__annotate_delete();
__alloc_traits::deallocate(this->__alloc_, this->__begin_, capacity());
this->__begin_ = this->__end_ = this->__cap_ = nullptr;
Expand Down
Loading