[libcxx-commits] [libcxx] [libc++][NFC] Simplify string a bit (PR #127135)
Peng Liu via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 20 08:49:19 PST 2025
================
@@ -3539,11 +3525,12 @@ inline _LIBCPP_CONSTEXPR_SINCE_CXX20 void basic_string<_CharT, _Traits, _Allocat
_LIBCPP_ASSERT_INTERNAL(__is_long(), "Trying to shrink small string");
// We're a long string and we're shrinking into the small buffer.
+ auto __ptr = __get_long_pointer();
+ auto __size = __get_long_size();
+ auto __cap = __get_long_cap();
----------------
winner245 wrote:
Thanks for the suggestion. I have changed the declaration to include `const`.
https://github.com/llvm/llvm-project/pull/127135
More information about the libcxx-commits
mailing list