Skip to content

Commit 5d8cd96

Browse files
committed
Address reviewer comments
1 parent 1a640a0 commit 5d8cd96

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

libcxx/include/string

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,11 +2711,11 @@ template <class _CharT, class _Traits, class _Allocator>
27112711
template <bool __is_short>
27122712
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Allocator>&
27132713
basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* __s, size_type __n) {
2714-
const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();
2715-
const auto __sz = __is_short ? __get_short_size() : __get_long_size();
2714+
const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();
2715+
const auto __size = __is_short ? __get_short_size() : __get_long_size();
27162716
if (__n < __cap) {
2717-
if (__n > __sz)
2718-
__annotate_increase(__n - __sz);
2717+
if (__n > __size)
2718+
__annotate_increase(__n - __size);
27192719
pointer __p;
27202720
if (__is_short) {
27212721
__p = __get_short_pointer();
@@ -2726,27 +2726,27 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* _
27262726
}
27272727
traits_type::copy(std::__to_address(__p), __s, __n);
27282728
traits_type::assign(__p[__n], value_type());
2729-
if (__sz > __n)
2730-
__annotate_shrink(__sz);
2729+
if (__size > __n)
2730+
__annotate_shrink(__size);
27312731
} else {
2732-
__grow_by_and_replace(__cap - 1, __n - __cap + 1, __sz, 0, __sz, __n, __s);
2732+
__grow_by_and_replace(__cap - 1, __n - __cap + 1, __size, 0, __size, __n, __s);
27332733
}
27342734
return *this;
27352735
}
27362736

27372737
template <class _CharT, class _Traits, class _Allocator>
27382738
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Allocator>&
27392739
basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type* __s, size_type __n) {
2740-
const auto __cap = capacity();
2741-
const auto __sz = size();
2740+
const auto __cap = capacity();
2741+
const auto __size = size();
27422742
if (__cap >= __n) {
2743-
if (__n > __sz)
2744-
__annotate_increase(__n - __sz);
2743+
if (__n > __size)
2744+
__annotate_increase(__n - __size);
27452745
value_type* __p = std::__to_address(__get_pointer());
27462746
traits_type::move(__p, __s, __n);
27472747
return __null_terminate_at(__p, __n);
27482748
} else {
2749-
__grow_by_and_replace(__cap, __n - __cap, __sz, 0, __sz, __n, __s);
2749+
__grow_by_and_replace(__cap, __n - __cap, __size, 0, __size, __n, __s);
27502750
return *this;
27512751
}
27522752
}
@@ -2781,11 +2781,11 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) {
27812781
__annotate_increase(1);
27822782
pointer __p;
27832783
if (__is_long()) {
2784-
__set_long_size(1);
27852784
__p = __get_long_pointer();
2785+
__set_long_size(1);
27862786
} else {
2787-
__set_short_size(1);
27882787
__p = __get_short_pointer();
2788+
__set_short_size(1);
27892789
}
27902790
traits_type::assign(*__p, __c);
27912791
traits_type::assign(*++__p, value_type());

0 commit comments

Comments
 (0)