Skip to content

Commit 8d1c3d9

Browse files
committed
more clang-tidy fixes
1 parent e2c27bd commit 8d1c3d9

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

libcxx/include/__split_buffer

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ public:
7676
_LIBCPP_HIDE_FROM_ABI explicit __split_buffer_pointer_layout(const allocator_type& __alloc)
7777
: __alloc_(__alloc) {}
7878

79-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer first() _NOEXCEPT { return __first_; }
79+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __first() _NOEXCEPT { return __first_; }
8080

81-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer first() const _NOEXCEPT { return __first_; }
81+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __first() const _NOEXCEPT { return __first_; }
8282

8383
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT { return __begin_; }
8484

@@ -194,9 +194,9 @@ public:
194194
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI explicit __split_buffer_size_layout(const allocator_type& __alloc)
195195
: __alloc_(__alloc) {}
196196

197-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer first() _NOEXCEPT { return __first_; }
197+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer __first() _NOEXCEPT { return __first_; }
198198

199-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer first() const _NOEXCEPT { return __first_; }
199+
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_pointer __first() const _NOEXCEPT { return __first_; }
200200

201201
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI pointer begin() _NOEXCEPT { return __begin_; }
202202

@@ -297,6 +297,8 @@ template <class _Tp,
297297
struct __split_buffer : _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _Allocator> {
298298
using __base_type _LIBCPP_NODEBUG = _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _Allocator>;
299299
using __base_type::__back_spare;
300+
using __base_type::__copy_without_alloc;
301+
using __base_type::__first;
300302
using __base_type::__front_spare;
301303
using __base_type::__reset;
302304
using __base_type::__set_begin;
@@ -306,7 +308,6 @@ struct __split_buffer : _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _
306308
using __base_type::__set_sentinel;
307309
using __base_type::__set_size_if_size_based;
308310
using __base_type::__swap_without_allocator;
309-
using __base_type::first;
310311

311312
using typename __base_type::__alloc_rr;
312313
using typename __base_type::__alloc_traits;
@@ -416,7 +417,7 @@ struct __split_buffer : _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _
416417
_NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value || __is_nothrow_swappable_v<__alloc_rr>);
417418

418419
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool __invariants() const {
419-
if (first() == nullptr) {
420+
if (__first() == nullptr) {
420421
if (begin() != nullptr)
421422
return false;
422423

@@ -428,7 +429,7 @@ struct __split_buffer : _Layout<__split_buffer<_Tp, _Allocator, _Layout>, _Tp, _
428429

429430
return true;
430431
} else {
431-
if (begin() < first())
432+
if (begin() < __first())
432433
return false;
433434

434435
if (capacity() < size())
@@ -572,16 +573,16 @@ __split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(size_type __cap, size_t
572573
__cap = __allocation.count;
573574
}
574575

575-
__set_begin(first() + __start);
576+
__set_begin(__first() + __start);
576577
__set_sentinel(begin());
577578
__set_capacity(__cap);
578579
}
579580

580581
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
581582
_LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator, _Layout>::~__split_buffer() {
582583
clear();
583-
if (first())
584-
__alloc_traits::deallocate(this->__alloc_, first(), capacity());
584+
if (__first())
585+
__alloc_traits::deallocate(this->__alloc_, __first(), capacity());
585586
}
586587

587588
template <class _Tp, class _Allocator, template <class, class, class> class _Layout>
@@ -596,16 +597,16 @@ _LIBCPP_CONSTEXPR_SINCE_CXX20
596597
__split_buffer<_Tp, _Allocator, _Layout>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
597598
: __base_type(__a) {
598599
if (__a == __c.__alloc_) {
599-
__set_first(first());
600+
__set_first(__first());
600601
__set_begin(begin());
601602
__set_sentinel(end());
602603
__set_capacity(capacity());
603604
__reset();
604605
} else {
605606
auto __allocation = std::__allocate_at_least(this->__alloc_, __c.size());
606607
__set_first(__allocation.ptr);
607-
__set_begin(first());
608-
__set_sentinel(this->first());
608+
__set_begin(__first());
609+
__set_sentinel(__first());
609610
__set_capacity(__allocation.count);
610611
typedef move_iterator<iterator> _Ip;
611612
__construct_at_end(_Ip(__c.begin()), _Ip(__c.end()));

0 commit comments

Comments
 (0)