Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Refactor memory allocation in basic_string #128423

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

philnik777
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented Feb 23, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 72791fef6d6c84b72cb961b288b25283bea97310 c4657a704e79898bc5357f97baa7505945b8de92 --extensions ,h,cpp -- libcxx/include/__memory/allocate_at_least.h libcxx/include/string libcxx/src/string.cpp libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp
View the diff from clang-format here.
diff --git a/libcxx/include/string b/libcxx/include/string
index 3330c7e434..e6be2c460a 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -2323,7 +2323,7 @@ private:
         auto __alloc      = __str.__alloc_;
         auto __allocation = __allocate_long_buffer(__alloc, __str.size());
         __replace_internal_buffer(__allocation, __str.size());
-        __alloc_   = std::move(__alloc);
+        __alloc_ = std::move(__alloc);
       }
     }
   }

@philnik777 philnik777 force-pushed the string_simplify_alloc branch from e0ab1dc to c4657a7 Compare February 23, 2025 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant