[libcxx-commits] [libcxx] 382f70a - [libc++][NFC] Rewrite function call on two lines for clarity (#79141)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 24 06:29:02 PST 2024
Author: Louis Dionne
Date: 2024-01-24T09:28:58-05:00
New Revision: 382f70a877f00ab71f3cb5ba461b52e1b59cd292
URL: https://github.com/llvm/llvm-project/commit/382f70a877f00ab71f3cb5ba461b52e1b59cd292
DIFF: https://github.com/llvm/llvm-project/commit/382f70a877f00ab71f3cb5ba461b52e1b59cd292.diff
LOG: [libc++][NFC] Rewrite function call on two lines for clarity (#79141)
Previously, there was a ternary conditional with a less-than comparison
appearing inside a template argument, which was really confusing because
of the <...> of the function template. This patch rewrites the same
statement on two lines for clarity.
Added:
Modified:
libcxx/include/string
Removed:
################################################################################
diff --git a/libcxx/include/string b/libcxx/include/string
index e97139206d4fa7..085178fe1a9ed0 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1948,8 +1948,8 @@ private:
if (__s < __min_cap) {
return static_cast<size_type>(__min_cap) - 1;
}
- size_type __guess =
- __align_it < sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1 > (__s + 1) - 1;
+ const size_type __boundary = sizeof(value_type) < __alignment ? __alignment / sizeof(value_type) : 1;
+ size_type __guess = __align_it<__boundary>(__s + 1) - 1;
if (__guess == __min_cap)
++__guess;
return __guess;
More information about the libcxx-commits
mailing list