[libcxx-commits] [libcxx] [libc++] Refactor how we do amortized growth (PR #171117)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 8 04:09:43 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions  -- libcxx/include/string --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/string b/libcxx/include/string
index e4020b46e..bc334257a 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -2299,7 +2299,7 @@ private:
       return std::max(__required_size, 2 * __current_cap);
     }();
 
-    __long __buffer = __allocate_long_buffer(__alloc_, __new_cap);
+    __long __buffer  = __allocate_long_buffer(__alloc_, __new_cap);
     __buffer.__size_ = __required_size;
     return __buffer;
   }

``````````

</details>


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


More information about the libcxx-commits mailing list