Skip to content

Commit ff05c97

Browse files
committed
Address reviewer comments
1 parent c1290e2 commit ff05c97

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
@@ -2707,11 +2707,11 @@ template <class _CharT, class _Traits, class _Allocator>
27072707
template <bool __is_short>
27082708
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Allocator>&
27092709
basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* __s, size_type __n) {
2710-
const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();
2711-
const auto __sz = __is_short ? __get_short_size() : __get_long_size();
2710+
const auto __cap = __is_short ? static_cast<size_type>(__min_cap) : __get_long_cap();
2711+
const auto __size = __is_short ? __get_short_size() : __get_long_size();
27122712
if (__n < __cap) {
2713-
if (__n > __sz)
2714-
__annotate_increase(__n - __sz);
2713+
if (__n > __size)
2714+
__annotate_increase(__n - __size);
27152715
pointer __p;
27162716
if (__is_short) {
27172717
__p = __get_short_pointer();
@@ -2722,27 +2722,27 @@ basic_string<_CharT, _Traits, _Allocator>::__assign_no_alias(const value_type* _
27222722
}
27232723
traits_type::copy(std::__to_address(__p), __s, __n);
27242724
traits_type::assign(__p[__n], value_type());
2725-
if (__sz > __n)
2726-
__annotate_shrink(__sz);
2725+
if (__size > __n)
2726+
__annotate_shrink(__size);
27272727
} else {
2728-
__grow_by_and_replace(__cap - 1, __n - __cap + 1, __sz, 0, __sz, __n, __s);
2728+
__grow_by_and_replace(__cap - 1, __n - __cap + 1, __size, 0, __size, __n, __s);
27292729
}
27302730
return *this;
27312731
}
27322732

27332733
template <class _CharT, class _Traits, class _Allocator>
27342734
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NOINLINE basic_string<_CharT, _Traits, _Allocator>&
27352735
basic_string<_CharT, _Traits, _Allocator>::__assign_external(const value_type* __s, size_type __n) {
2736-
const auto __cap = capacity();
2737-
const auto __sz = size();
2736+
const auto __cap = capacity();
2737+
const auto __size = size();
27382738
if (__cap >= __n) {
2739-
if (__n > __sz)
2740-
__annotate_increase(__n - __sz);
2739+
if (__n > __size)
2740+
__annotate_increase(__n - __size);
27412741
value_type* __p = std::__to_address(__get_pointer());
27422742
traits_type::move(__p, __s, __n);
27432743
return __null_terminate_at(__p, __n);
27442744
} else {
2745-
__grow_by_and_replace(__cap, __n - __cap, __sz, 0, __sz, __n, __s);
2745+
__grow_by_and_replace(__cap, __n - __cap, __size, 0, __size, __n, __s);
27462746
return *this;
27472747
}
27482748
}
@@ -2777,11 +2777,11 @@ basic_string<_CharT, _Traits, _Allocator>::operator=(value_type __c) {
27772777
__annotate_increase(1);
27782778
pointer __p;
27792779
if (__is_long()) {
2780-
__set_long_size(1);
27812780
__p = __get_long_pointer();
2781+
__set_long_size(1);
27822782
} else {
2783-
__set_short_size(1);
27842783
__p = __get_short_pointer();
2784+
__set_short_size(1);
27852785
}
27862786
traits_type::assign(*__p, __c);
27872787
traits_type::assign(*++__p, value_type());

0 commit comments

Comments
 (0)