[libcxx-commits] [libcxx] [libc++] Remove unnecessary assignments (PR #78678)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 22 09:41:13 PST 2024


================
@@ -1459,26 +1459,20 @@ vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x) {
 template <class _Tp, class _Allocator>
 _LIBCPP_CONSTEXPR_SINCE_CXX20 inline _LIBCPP_HIDE_FROM_ABI void
 vector<_Tp, _Allocator>::push_back(const_reference __x) {
-  pointer __end = this->__end_;
-  if (__end < this->__end_cap()) {
+  if (this->__end_ < this->__end_cap()) {
----------------
ldionne wrote:

This was added in 6fe4e033f07d332980e1997c19fe705cff9d07a4, which optimized `std::vector`. Removing those would be a performance regression. Unfortunately we have benchmarks but no automated performance regression tests right now.

https://github.com/llvm/llvm-project/pull/78678


More information about the libcxx-commits mailing list